tenzap commented on issue #8082: URL: https://github.com/apache/netbeans/issues/8082#issuecomment-2561961381
Sorry for misunderstanding. For all use cases below, in the project properties / testing / testdirs, set the path to "/absolute/path/to/project/tests" dir. ## Group A This is the expected result for the branch **nb24-issue8082** of https://github.com/tenzap/phpunit-simple-example/tree/nb24-issue8082 ### Case A1 Check only - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Test project using just phpunit command Run tests (ALT+F6) **Doesn't work** as expected: ie. phpunit is invoked without the testdir argument which is correct and since there is no check for 'use XML configuration', no configuration is added to the command line which is correct. However, phpunit prints the usage. This is because it is likely that it is not invoked from the root dir of the project. Expected behavior: phpunit should be invoked from the root dir of the project. With this changed, phpunit will be able to run the tests. ### Case A2 Check only - use XML configuration (/absolute/path/to/project/phpunit.xml) - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Test project using just phpunit command Run tests (ALT+F6) Works as expected: ie. phpunit is invoked without with the testdir argument and phpunit runs the test according to xml file. ### Case A3 Check only - use XML configuration (/absolute/path/to/project/phpunit.xml) - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Test project using just phpunit command - Ask for test groups before running tests Run tests (ALT+F6) **Doesn't work** as expected: ie. netbeans invokes phpunit with the "." argument. Expected behavior: It should invoke phpunit without the "." dir ### Case A4 Check only - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Test project using just phpunit command - Ask for test groups before running tests Run tests (ALT+F6) **Doesn't work** as expected: ie. netbeans invokes phpunit with the "." argument. Expected behavior: It should invoke phpunit without the testdir argument. And since there is not check for 'use XML configuration', no configuration is added to the command line which is correct. Moreover, phpunit should be invoked from the root dir of the project (I can't check if this is the case, but I think it is already the case) ## Group B This is the expected result for the branch **nb24-issue8082-caseB** of https://github.com/tenzap/phpunit-simple-example/tree/nb24-issue8082-caseB. The checkboxes to tick are like the 4 use cases above, except that we always keep `Test project using just phpunit command` unchecked. ### Case B1 Check only - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) Run tests (ALT+F6) Works as expected: ie. phpunit is invoked with the testdir argument which is correct and since there is no check for 'use XML configuration', no configuration is added to the command line which is correct. ### Case B2 Check only - use XML configuration (/absolute/path/to/project/phpunit.xml) - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) Run tests (ALT+F6) Works as expected: ie. phpunit is invoked with the testdir argument and phpunit runs the test according to xml file. ### Case B3 Check only - use XML configuration (/absolute/path/to/project/phpunit.xml) - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Ask for test groups before running tests Run tests (ALT+F6) **Doesn't work** as expected: ie. netbeans invokes phpunit with the "." argument. Expected behavior: It should invoke phpunit with the testdir argument as set in the project properties / testing / testdirs, ie "/absolute/path/to/project/tests" dir. ### Case B4 Check only - use Custom PHPUnit Script (/absolute/path/to/project/vendor/bin/phpunit) - Ask for test groups before running tests Run tests (ALT+F6) **Doesn't work** as expected: ie. netbeans invokes phpunit with the "." argument. While it lists the groups in netbeans, I think the behavior could be different to be more consistent with the behavior when "use xml configuration" is set. Expected behavior: It should invoke phpunit with the testdir argument. And since there is no check of 'use XML configuration', no configuration is added to the command line which is correct. Moreover, phpunit should be invoked from the root dir of the project (I can't check if this is the case, but I think it is already the case). ## Group A & B So in all cases: - if "Test project using just phpunit command" is ticked, the testdir or "." (in case of --list-groups) should never be appended. If it is unticked, it should always add the testdir (also in case of --list-group) to the phpunit invocation. - phpunit should be invoked from the root dir of the project in all cases Hopefully I haven't made mistakes or misunderstood the way phpunit works. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
