Page MenuHomePhabricator

Php unit seems to use some sort of crappy directory relativity
Closed, ResolvedPublic

Description

reedy@ubuntu64-web-esxi:~/mediawiki/trunk/phase3$ php tests/phpunit/phpunit.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Unexpected non-MediaWiki exception encountered, of type "RuntimeException"
exception 'RuntimeException' with message 'Cannot open file "././suites/UploadFromUrlTestSuite.php".
' in /usr/share/php/PHPUnit/Util/Fileloader.php:76
Stack trace:
#0 /usr/share/php/PHPUnit/Framework/TestSuite.php(382): PHPUnit_Util_Fileloader::checkAndLoad('./suites/Upload...', false)
#1 /usr/share/php/PHPUnit/Util/Configuration.php(772): PHPUnit_Framework_TestSuite->addTestFile('./suites/Upload...', false)
#2 /usr/share/php/PHPUnit/Util/Configuration.php(715): PHPUnit_Util_Configuration->getTestSuite(Object(DOMElement), false)
#3 /usr/share/php/PHPUnit/TextUI/Command.php(659): PHPUnit_Util_Configuration->getTestSuiteConfiguration(false)
#4 /usr/share/php/PHPUnit/TextUI/Command.php(138): PHPUnit_TextUI_Command->handleArguments(Array)
#5 /home/reedy/mediawiki/trunk/phase3/tests/phpunit/MediaWikiPHPUnitCommand.php(31): PHPUnit_TextUI_Command->run(Array, true)
#6 /home/reedy/mediawiki/trunk/phase3/tests/phpunit/phpunit.php(60): MediaWikiPHPUnitCommand::main()
#7 {main}

#0 /usr/share/php/PHPUnit/Framework/TestSuite.php(382): PHPUnit_Util_Fileloader::checkAndLoad('./suites/Upload...', false)
#1 /usr/share/php/PHPUnit/Util/Configuration.php(772): PHPUnit_Framework_TestSuite->addTestFile('./suites/Upload...', false)
#2 /usr/share/php/PHPUnit/Util/Configuration.php(715): PHPUnit_Util_Configuration->getTestSuite(Object(DOMElement), false)
#3 /usr/share/php/PHPUnit/TextUI/Command.php(659): PHPUnit_Util_Configuration->getTestSuiteConfiguration(false)
#4 /usr/share/php/PHPUnit/TextUI/Command.php(138): PHPUnit_TextUI_Command->handleArguments(Array)
#5 /home/reedy/mediawiki/trunk/phase3/tests/phpunit/MediaWikiPHPUnitCommand.php(31): PHPUnit_TextUI_Command->run(Array, true)
#6 /home/reedy/mediawiki/trunk/phase3/tests/phpunit/phpunit.php(60): MediaWikiPHPUnitCommand::main()
#7 {main}
reedy@ubuntu64-web-esxi:~/mediawiki/trunk/phase3$ cd tests/phpunit/
reedy@ubuntu64-web-esxi:~/mediawiki/trunk/phase3/tests/phpunit$ php phpunit.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHPUnit 3.5.5 by Sebastian Bergmann.

Test Suite
includes

 TitlePermissionTest
^C

reedy@ubuntu64-web-esxi:~/mediawiki/trunk/phase3/tests/phpunit$ php phpunit.php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/sqlite.so' - /usr/lib/php5/20090626/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHPUnit 3.5.5 by Sebastian Bergmann.

Test Suite
includes

 TitlePermissionTest
.......

ArticleTablesTest
.

XmlJs
.

RevisionTest
........

ZipDirectoryReaderTest
..........

ParserOptionsTest
.

Version: 1.20.x
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=42506

Details

Reference
bz32022

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:59 PM
bzimport set Reference to bz32022.

I'm surprised you only noticed this now. The fact that you need to cd into the dir where phpunit.php is has annoyed me for a long time already.

Fixed in r101480 by playing with include_path and fixing some paths in suite.xml

Not tagged for REL1_18, I do not think there is any need for that there.

Please reopen this bug and mark revision as fix me if there is any issue.