Ubuntu

phpunit requires PHP_CodeCoverage

Reported by Alexander Shwets on 2011-01-11
302
This bug affects 64 people
Affects Status Importance Assigned to Milestone
pear-phpunit-channel (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
php-codecoverage (Ubuntu)
Undecided
Unassigned
Precise
Medium
Micah Gersten
php-file-iterator (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
php-text-template (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
php-token-stream (Ubuntu)
Undecided
Unassigned
Precise
Undecided
Unassigned
phpunit (Debian)
Fix Released
Unknown
phpunit (Ubuntu)
High
Unassigned
Precise
Medium
Micah Gersten

Bug Description

Binary package hint: phpunit

PHPUnit requires PHP_CodeCoverage, but there is no one in this or other deb package.

So, we have error until install PHP_CodeCoverage from PEAR:
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38

phpunit (3.5.5-2)

Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this bug and making Ubuntu better!

I got the same error when running phpunit on Natty.

Changed in phpunit (Ubuntu):
status: New → Confirmed
Changed in phpunit (Debian):
status: Unknown → New
Gonzalo Cao (gonzalo-cao) wrote :

Same problem detected. Phpunit has been working in 10.10 until migration to 11.04 beta. Now I get this error:

xxxx@xxxx:~$ phpunit
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0

David JM Emmett (davidjmemmett) wrote :

Has anything happened with this issue since February?

Hans Joachim Desserud (hjd) wrote :

David: Have you taken a look at the Debian bug? It links to another bug report discussing packaging PHP CodeCoverage.

Ricardo Coelho (ram-coelho) wrote :

I know this won't solve the issue, but maybe someone hit this page looking for a workaround. Try this:

sudo apt-get remove phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit

Tharakan (tharakan) wrote :

I confirm that the steps provided by Ricardo (on 2011-05-13) are working fine for Ubuntu 11.04. Just that you would need to install phpunit using apt-get in the end, once again.

For convenience, the steps again below:

sudo apt-get remove phpunit
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
sudo apt-get install phpunit

spe (jspeshu) wrote :

even though i did ths steps as recommended above, i didn't get it to work but after i upgraded pear from 1.9.1 to 1.9.2 it's working perfectly just do this

speshu@speshu-laptop:~$ sudo pear upgrade pear

       downloading PEAR-1.9.2.tgz ...
       Starting to download PEAR-1.9.2.tgz (295,120 bytes)
        .....................................................done: 295,120 bytes
        upgrade ok: channel://pear.php.net/PEAR-1.9.2
        PEAR: Optional feature webinstaller available (PEAR's web-based installer)
        PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
        PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
        PEAR: To install optional features use "pear install pear/PEAR#featurename"

spe (jspeshu) wrote :

and am using 11.04 ...

Steffen H. (shulegaa) wrote :

   On a totally up-to-date Ubuntu 11.04 system, sudo apt-get install phpunit still installs a completely useless phpunit package - as reported about a year ago above. How does this sort of package pass even the most cursory of QA checks? This precedent is a bit disturbing. I imagine I just don't know the story/context. At any rate:

phpunit --verbose
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38

    Even following the work-around, there's a non-fatal configuration problem. I'm not sure when/if this will cause any hard-to-diagnose side-effects:

phpunit --verbose .
PHP Notice: Please no longer include "PHPUnit/Framework.php". in /usr/share/php/PHPUnit/Framework.php on line 50
PHPUnit 3.5.5 by Sebastian Bergmann.

    It looks as if PHP is going to require using PEAR more than apt-get. Hmm. This sounds like a slippery slope.

    By the way, I followed the amalgamated work-around contributed above. A *huge* thanks to to posters above:

sudo apt-get remove phpunit
sudo pear upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit
sudo apt-get install phpunit

Cheers

Cinquero (cinquero) wrote :

have that problem too. First answer at

http://stackoverflow.com/questions/1528717/phpunit-require-once-error

solved it. Also affects Ubuntu 11.04.

jphuart (jeanpierrehuart) wrote :

Thanks to everybody for the contributions.
I'm using ubuntu 10.10 64bits and had the same problem.
I applied what proposed by Steffen, but I skipped the last line.
I just want to mention that there is no need to re-install phpunit (sudo apt-get install phpunit) to make it working.

Ciao

VolCh (vcher) wrote :

In 11.10 this issue still here

Here on 11.10 64-bit bug still present.

Solution mentioned on comment #10 (ref. stackoverflow) was not sufficient.

Solution mentioned at end of comment #9 (with uninstall/reinstall phpunit), same as comment #6 worked quickly.

Unbelievable. QA is just missing in Ubuntu.

John Faucett (jwaterfaucett) wrote :

Still not working:
  Ubuntu 11.10 x86_64 Linux

Here's what I had to do: (same as above just don't run apt-get install - didn't work for me)

sudo apt-get remove phpunit
sudo apt-get upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit

then test with:

phpunit --version

if you get the Sebastian Bergmann everything should work fine from there.

followed this guys stuff
http://www.giocc.com/installing-phpunit-on-ubuntu-11-04-natty-narwhal.html

Cinquero (cinquero) wrote :

The problem still persists in Ubuntu Precise.

> Unbelievable. QA is just missing in Ubuntu.

That's not only Ubuntu, it is almost the entire open-source realm except where professional products are actively being worked on. Debian should really start to throw out packages without proper (that is automatic and complete) integration tests. Instead, Ubuntu and GNOME people start to work on fancy desktop managers -- stuff which is practically useless. Debian should also start to only accept bug reports in the form of regression tests. And it should reject package upgrades if regression tests cannot be re-used and the new tests are of lower quality....

Changed in phpunit (Debian):
status: New → Fix Released
Aleksander Machniak (al3c) wrote :

Still not fixed.

PowerKiKi (adrien-crivelli) wrote :

On Ubuntu 12.04, experienced same issue:

$ sudo apt-get install phpunit
$ phpunit
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
[...]

Workaround from John Faucett worked great, on the condition to update symphony url, as follow:

sudo apt-get remove phpunit
sudo apt-get upgrade pear
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony.com
sudo pear channel-discover components.ez.no
sudo pear update-channels
sudo pear upgrade-all
sudo pear install --alldeps phpunit/PHPUnit

Tomasz Ducin (tomasz-ducin) wrote :

Confirm @PowerKiKi - the problem is still there. The workaround is really nasty.

pearlbear (michelle-murrain) wrote :

Any news on this? Confirmed from here.

Stephen Rees-Carter (valorin) wrote :

Is there any point to having phpunit in the Ubuntu repos?

It's a piece of cake to install via Composer or PEAR. Both those two methods will get you the latest version too rather than an out-dated version.

Daniel Hahler (blueyed) wrote :

Ubuntu 12.10 (Quantal) now has php-codecoverage.

Changed in phpunit (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
Daniel Hahler (blueyed) on 2013-01-17
Changed in phpunit (Ubuntu):
status: Triaged → Fix Released
Hans Joachim Desserud (hjd) wrote :

Does that mean bug 755973 can be closed too? Afterall, it was linked to the same Debian bug.

Micah Gersten (micahg) wrote :

I think we should try to SRU php-codecoverage to precise and update the dependency since PHPUnit is broke by default without it.

Changed in phpunit (Ubuntu Precise):
assignee: nobody → Micah Gersten (micahg)
importance: Undecided → High
status: New → Triaged
Changed in php-codecoverage (Ubuntu):
status: New → Fix Released
Changed in php-codecoverage (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Changed in phpunit (Ubuntu Precise):
importance: High → Medium
Changed in php-codecoverage (Ubuntu Precise):
assignee: nobody → Micah Gersten (micahg)
Micah Gersten (micahg) wrote :

I'll have to talk to the SRU team as this will require 4 new dependencies (pear-phpunit-channel php-text-template php-file-iterator php-token-stream)

Micah Gersten (micahg) on 2013-04-14
Changed in pear-phpunit-channel (Ubuntu):
status: New → Invalid
Changed in php-file-iterator (Ubuntu):
status: New → Invalid
Changed in php-text-template (Ubuntu):
status: New → Invalid
Changed in php-token-stream (Ubuntu):
status: New → Invalid
LexLythius (lexlythius) wrote :

Any news in this respect?
I believe that until this is fixed in precise (current LTS server version, by the way), we would be better off if you just leave some sort of dummy package with instructions to download the real thing through PEAR. We wouldn't waste time trying to get this one to work in the meantime.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pear-phpunit-channel (Ubuntu Precise):
status: New → Confirmed
Changed in php-file-iterator (Ubuntu Precise):
status: New → Confirmed
Changed in php-text-template (Ubuntu Precise):
status: New → Confirmed
Changed in php-token-stream (Ubuntu Precise):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.