Phpunit not recognized by Cakephp

Asked

Viewed 184 times

2

Now with the discontinuation of Phpunit support by Pear, I started to face a big problem to make Cakephp recognize Phpunit...

Phpunit is already installed on my computer (Linux Mint), I can use it from the console without problems but when using the Cakephp test API I am not successful.

I tried to install by Poser itself, but I realized that the content of Phpunit goes to the Vendor folder and has a folder division that I really don’t understand. I don’t know if that information is relevant...

When I access the test.php file, to access the tests, the following errors are presented to me:

Warning (2): include(Phpunit/Autoload.php): failed to open stream: No such file or directory [CORE/Cake/Testsuite/Caketestsuitedispatcher.php, line 156]

Warning (2): include() [Function.include]: Failed Opening 'Phpunit/Autoload.php' for inclusion (include_path='/var/www/html/sapekas/lib:/usr/lib/php:.') [CORE/Cake/Testsuite/Caketestsuitedispatcher.php, line 156]

I searched all over the internet in various ways but I couldn’t find a solution. The vast majority always spoke to beg to install Phpunit, but it no longer supports this, so it’s a new problem and I believe that’s why there isn’t much material yet on how to solve

1 answer

0

You can use Phpunit from your own application that is inside the vendor folder. if you are using Composer, try the following command on the console inside your project folder:

/vendor/bin/phpunit

  • As stated above, I can use Phpunit perfectly from the console, but my problem is using the Cakephp test API through the test.php file

Browser other questions tagged

You are not signed in. Login or sign up in order to post.