Last modified: 2012-12-08 22:37:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44711, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42711 - phpunit installing script not detecting same version as phpunit.php
phpunit installing script not detecting same version as phpunit.php
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-05 02:21 UTC by Ryan Kaldari
Modified: 2012-12-08 22:37 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ryan Kaldari 2012-12-05 02:21:57 UTC
Here's what happens when I try to run install-phpunit.sh and then phpunit.php:

rkaldari$ sudo ./install-phpunit.sh
Installing phpunit with pear
Channel "pear.phpunit.de" is already initialized
Channel "components.ez.no" is already initialized
Channel "pear.symfony-project.com" is already initialized
phpunit/PHPUnit is already installed and is the same as the released version 3.7.10
install failed
rkaldari$ which phpunit
rkaldari$ php phpunit.php
PHPUnit 3.6.7 or later required, you have 3.5.15.

I already have phpunit installed, but it's an old version, but for some reason install-phpunit.sh thinks I'm totally up to date. Perhaps I have more than one phpunit installed and it's checking the wrong one, or perhaps phpunit.php is checking the wrong one.

Any help would be appreciated.
Comment 1 Antoine "hashar" Musso (WMF) 2012-12-05 11:13:55 UTC
PHPUnit comes both with a `phpunit` CLI script and a set of lib files.

The `phpunit` command is looked up according to your $PATH environment. On my install pear put it in /usr/local/bin :

 $ pear config-show |grep executables
 PEAR executables directory     bin_dir          /opt/local/bin

My libraries are installed under /opt/local/share/pear :

 $ pear config-show |grep php_dir
 PEAR directory                 php_dir          /opt/local/share/pear

The libraries are looked up according to the include_path setting of your php.ini file. So include_path=".:/opt/local/share/pear".

When you run "php phpunit.php", PHP lookup your include_path and seems to find a PHPUnit copy installed by your distribution, probably something like /usr/share/php/PEAR.

To fix your problem you should:

1) include in your PATH the PEAR bin dir : pear config-show |grep executables
2) fix your include_path in /etc/php.ini so it points to PEAR php dir : pear config-show |grep php_dir

Optionally: remove the phpunit package installed by your distribution :-)
Comment 2 Antoine "hashar" Musso (WMF) 2012-12-08 22:37:50 UTC
Assuming this is going to work :-)   Anyway that is not really a bug, more a support request.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links