Question

I want to how to setup phpunit in fuelphp. I already updates my composer.phar after including in composer.json this code:

"require-dev": {
    "phpunit/phpunit": "3.7.14" 

but when i try to test in terminal(mac osX), it will got an error, it say:

$ php oil

Warning: require(/Applications/XAMPP/xamppfiles/htdocs/unishelf-web/fuel/app/app/config.php): failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/unishelf-web/fuel/app/bootstrap.php on line 6

Fatal error: require(): Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/unishelf-web/fuel/app/app/config.php' (include_path='.:') in /Applications/XAMPP/xamppfiles/htdocs/unishelf-web/fuel/app/bootstrap.php on line 6

I try another way to, like make a dir 'phpUnit' in my web dir. i put my code there, type this command line in terminal:

./vendor/bin/phpunit phpUnit/test/importdocumentsTest.php 

still got error message,

Fatal error: Class 'Input' not found

if anybody know bout this, please let me know.

No correct solution

OTHER TIPS

Your FuelPHP installation seems to be broken. How did you install it?

Here is how to:

$ curl get.fuelphp.com/oil | sh
$ oil create fuel_project
$ cd fuel_project
$ php composer.phar require phpunit/phpunit:3.7.* --dev

Copy fuel/packages/oil/config/oil.php to fuel/app/config/.

Edit it 'binary_path' to

'binary_path' => VENDORPATH.'bin/phpunit',

For example, you can run FuelPHP Core tests:

$ oil test --group=Core

You may want to try this, this worked for me. Easiest way to obtain PHPUnit is to download a PHP Archive (PHAR).

(1) Install PHPUNIT globally

wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
phpunit --version

(2) Copy "fuel/packages/oil/config/oil.php" to "fuel/app/config/oil.php"

(3) Change the binary path to

 'binary_path' => '/usr/local/bin/phpunit'  

(4) now test your fuelphp

 fuelphp oil test
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top