#27250 closed enhancement (fixed)
Exception when running import unit test group without the importer installed
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.9 |
Component: | Import | Keywords: | |
Focuses: | Cc: |
Description
When running the import unit test group without having the WordPress Importer installed, it throws an exception when trying to include the importer plugin files.
I have made a patch that skips these tests if the plugin is not installed.
PHP Warning: Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'require_once(/srv/www/wordpress-trunk.dev/tests/phpunit/includes/../data/plugins/wordpress-importer/wordpress-importer.php): failed to open stream: No such file or directory' in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php:17 Stack trace: #0 /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php(17): PHPUnit_Util_ErrorHandler::handleError(2, 'require_once(/s...', '/srv/www/wordpr...', 17, Array) #1 /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php(17): Tests_Import_Import::setUp() #2 /usr/share/php/PHPUnit/Framework/TestCase.php(835): Tests_Import_Import->setUp() #3 /usr/share/php/PHPUnit/Framework/TestResult.php(648): PHPUnit_Framework_TestCase->runBare() #4 /usr/share/php/PHPUnit/Framework/TestCase.php(783): PHPUnit_Framework_TestResult->run(Object(Tests_Import_Import)) #5 /usr/share/php/PHPUnit/Framework/TestSuite.php(775): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php on line 17 PHP Fatal error: Tests_Import_Import::setUp(): Failed opening required '/srv/www/wordpress-trunk.dev/tests/phpunit/includes/../data/plugins/wordpress-importer/wordpress-importer.php' (include_path='.:/usr/share/php:/usr/share/pear') in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php on line 17 Warning: Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'require_once(/srv/www/wordpress-trunk.dev/tests/phpunit/includes/../data/plugins/wordpress-importer/wordpress-importer.php): failed to open stream: No such file or directory' in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php:17 Stack trace: #0 /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php(17): PHPUnit_Util_ErrorHandler::handleError(2, 'require_once(/s...', '/srv/www/wordpr...', 17, Array) #1 /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php(17): Tests_Import_Import::setUp() #2 /usr/share/php/PHPUnit/Framework/TestCase.php(835): Tests_Import_Import->setUp() #3 /usr/share/php/PHPUnit/Framework/TestResult.php(648): PHPUnit_Framework_TestCase->runBare() #4 /usr/share/php/PHPUnit/Framework/TestCase.php(783): PHPUnit_Framework_TestResult->run(Object(Tests_Import_Import)) #5 /usr/share/php/PHPUnit/Framework/TestSuite.php(775): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php on line 17 Fatal error: Tests_Import_Import::setUp(): Failed opening required '/srv/www/wordpress-trunk.dev/tests/phpunit/includes/../data/plugins/wordpress-importer/wordpress-importer.php' (include_path='.:/usr/share/php:/usr/share/pear') in /srv/www/wordpress-trunk.dev/tests/phpunit/tests/import/import.php on line 17
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
More information -
This plugin should be included in the
/tests/phpunit/data/plugins
directory.When you get the code from SVN, this is included as the importer is an SVN external.
However the importer plugin isn't included if you use the git mirror - git://develop.git.wordpress.org/
Perhaps the tests should fail instead of skip?