Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What ever happened to PHPUnit's Database Extension?

Tags:

php

phpunit

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.

like image 646
Jeune Avatar asked Jul 19 '11 10:07

Jeune


3 Answers

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 composer to install PHPUnit. It's less hassle.

like image 50
edorian Avatar answered Nov 08 '22 21:11

edorian


Use this

pear install phpunit/PHPUnit_Story
like image 34
boksiora Avatar answered Nov 08 '22 21:11

boksiora


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.

like image 1
Jeune Avatar answered Nov 08 '22 20:11

Jeune