php - What ever happened to PHPUnit's Database Extension?
After upgrading to PHPUnit v > 3.5 (I forgot) I kept on getting this error because I imported PHPUnit/Extensions/Database/TestCase.php:
require_once(...): failed to open stream: No such file or directory
I peeked at the PHPUnit folder in my /usr/share/php folder only to find out it isn't there anymore.
In fact a look at the official source code reveals that it seems it has been removed.
So for now I am using version 3.4.15. But it's not ideal as assertions on the table are still not supported. For now I am only able to use the CLEAN_INSERT feature which populates my database.
Answer
Solution:
Your installation seems broken. PHPUnit 3.5 got split up in more seperate packages.
Use
pear install phpunit/dbUnit
to install that part.Package overview: http://pear.phpunit.de/
Or to reinstall everything use:
pear install --force --alldeps phpunit/phpunit
2013 update:
Just use to install PHPUnit. It's less hassle.
Answer
Solution:
Use this
Answer
Solution:
I solved this by installing db unit manually. I downloaded it from here. Then I replaced the incomplete Extensions/Database folder with the one from the download.
Answer
Solution:
For those that are running macports, you will have to install the php5-unit-db port to get the needed files. This did help me start looking in the right direction. This dep was not installed by default.
Answer
Solution:
This should solve all problems with installing PHPUnit:
Answer
Solution:
On the current stable PHPUnit (4.5), DbUnit is an optional package that can be installed with Composer: https://phpunit.de/manual/current/en/installation.html#installation.optional-packages
(click the "Composer" hyperlink if you're not familiar with Composer--I wasn't and it was easy to set up in about 10 minutes)
I struggled before I found that, but was running with an older version of PHPUnit, and had it in a few places, so I removed it from /usr/local/bin and /usr/bin and then followed the instructions "To globally install the PHAR" found here: https://phpunit.de/manual/4.5/en/installation.html
I didn't have much luck using pear to install PHPUnit.
(I'm on a Mac running Yosemite).