Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 6 years ago

#27250 closed enhancement (fixed)

Exception when running import unit test group without the importer installed

Reported by: mattheu's profile mattheu Owned by: sergeybiryukov's profile SergeyBiryukov
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)

27250.diff (2.5 KB) - added by mattheu 11 years ago.

Download all attachments as: .zip

Change History (6)

@mattheu
11 years ago

#1 @mattheu
11 years ago

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?

#2 @willmot
11 years ago

I also ran into this when I switched over to the git mirror.

FYI @mattheu, looks like you inadvertantly included your changes to wp-config-sample.php in 27250.diff

#3 @SergeyBiryukov
11 years ago

  • Milestone changed from Awaiting Review to 3.9

#4 @SergeyBiryukov
11 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 27349:

Skip import tests if WordPress Importer plugin is missing.

props mattheu.
fixes #27250.

Note: See TracTickets for help on using tickets.