1

I have a CakePHP app on my machine. I've downloaded it just from svn repository(so, not composer or pear installing). PHPunit is installed at my machine globally. So when I'm trying to test some Model for example: cake test app Model/SomeModel I get this errors:

Warning Error: include(PHPUnit/Autoload.php): failed to open stream: No such file or directory in [/var/www/html/shaufel_batch/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php, line 146]

Warning Error: include(): Failed opening 'PHPUnit/Autoload.php' for inclusion (include_path='/var/www/html/shaufel_batch/lib:.:/Users/admin/pear/share/pear:/php/includes:/usr/bin:/usr/lib/php/:/usr/share/php') in [/var/www/html/shaufel_batch/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php, line 146]

Error: Please install PHPUnit framework (http://www.phpunit.de)
#0 /var/www/html/shaufel_batch/lib/Cake/Console/ShellDispatcher.php(206): TestShell->initialize()
#1 /var/www/html/shaufel_batch/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#2 /var/www/html/shaufel_batch/app/Console/cake.php(36): ShellDispatcher::run(Array)
#3 {main}

So how can I solve this problem in the app, which was just downloaded from svn repository ? Thanks for your time. My CakePHP version is 2.4.4

5
  • What OS are you using? Basically, you just need to install php-unit. On Debian/Ubuntu systems you can run apt-get install phpunit. See the link you posted: phpunit.de/manual/current/en/installation.html Commented Dec 9, 2016 at 9:56
  • @varlogtim, I am using Ubuntu 16.04, I did just so, I wrote in my post, the Phpunit is globally installed on my machine Commented Dec 9, 2016 at 10:01
  • @varlogtim, actually thanks, I just needed to reinstall the phpunit, and now all works fine Commented Dec 9, 2016 at 10:03
  • If you checked out a project via SNV it doesn't mean you can't use composer. You can even set up an old project to use composer by just adding the composer.json file and follow book.cakephp.org/2.0/en/installation/… Composer will save you a lot of time and trouble. Commented Dec 9, 2016 at 10:17
  • @burzum, thanks for your reply, I'll check it out. Commented Dec 9, 2016 at 10:24

1 Answer 1

1

On Debian/Ubuntu systems you can run apt-get install phpunit.

Other systems: http://phpunit.de/manual/current/en/installation.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I just needed to reinstall the phpunit, and now all works fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.