This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | PHPUnit tests fail to execute tests for WordPress project that work from command line | ||
---|---|---|---|
Product: | php | Reporter: | rweaver <rweaver> |
Component: | PHPUnit | Assignee: | Tomas Mysik <tmysik> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | rweaver, vriha |
Priority: | P3 | ||
Version: | 8.0.2 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Dialog for PHPUnit configuration |
Description
rweaver
2014-10-06 00:23:48 UTC
I will test it but what comes to my mind right now - working directory of NetBeans is the TESTS folder which is usually different from project folder. This means that the phpunit.xml.dist is not used by phpunit CLI. So, the question is what should be the default working directory - project directory or test directory? I don't know and I am not sure whether there is just one correct answer for it :) However, if one select the phpunit.xml.dist file as a PHPUnit configuration file in Project Properties dialog, I guess it should work then. Will try it. Thanks for reporting. OK, will not test it since apparently it needs WP installation and proper configuration :/ But I guess that my previous comment is correct - could you please test it? Please, let us know (simply reopen this issue). Thanks. One more idea - what will happen if you run the NetBeans command from the tests directory (instead of project directory)? Thanks. Created attachment 152996 [details]
Dialog for PHPUnit configuration
(In reply to Tomas Mysik from comment #3) > One more idea - what will happen if you run the NetBeans command from the > tests directory (instead of project directory)? > > Thanks. Same results as running from NetBeans: server:tests robweaver$ "/usr/local/bin/php" "/usr/local/bin/phpunit" "--colors" "--log-junit" "/var/folders/wk/kl5ptc6d6gj1bzlw4lr9yhmm0000gn/T/nb-phpunit-log.xml" "--configuration" "/Volumes/ServerHD2/Projects/WordPress/phpunit.xml.dist" "/Applications/NetBeans/NetBeans 8.0.1.app/Contents/Resources/NetBeans/php/phpunit/NetBeansSuite.php" "--run=/Volumes/ServerHD2/Projects/WordPress/tests" Installing... Running as single site... To run multisite, use -c tests/phpunit/multisite.xml Not running ajax tests. To execute these, use --group ajax. Not running ms-files tests. To execute these, use --group ms-files. Not running external-http tests. To execute these, use --group external-http. PHP Notice: Constant WP_DEBUG already defined in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 20 Notice: Constant WP_DEBUG already defined in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 20 PHP Warning: require_once(/Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-testlib/utils.php): failed to open stream: No such file or directory in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 34 Warning: require_once(/Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-testlib/utils.php): failed to open stream: No such file or directory in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 34 PHP Fatal error: require_once(): Failed opening required '/Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-testlib/utils.php' (include_path='.:/usr/local/Cellar/php56/5.6.4/lib/php') in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 34 Fatal error: require_once(): Failed opening required '/Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-testlib/utils.php' (include_path='.:/usr/local/Cellar/php56/5.6.4/lib/php') in /Volumes/ServerHD2/Projects/WordPress/tests/phpunit/wp-mail-real-test.php on line 34 I can run phpunit from the root project folder and get the expected test results. In such case, I guess that the problem could be with our PHPUnit Suite (NetBeansSuite.php), I will try to look at it. Thanks. I just added an option to test project using just 'phpunit' command. See Project Properties dialog, PHPUnit category. Note: Do not forget to select proper XML configuration in this dialog otherwise it will not work. So,this issue should be fixed now, I hope. Please, let us know if not. Thanks. http://hg.netbeans.org/web-main/rev/36719c55ddd8 |