0

I started update CakePHP 3.5 to 3.6, but when I try check my code by tests, i got error:

InvalidArgumentException: The plugin class Migrations\Plugin cannot be found. Ensure your autoloader is correct.

After, I runed command php composer.phar require --dev phpunit/phpunit:"^5.7|^6.0"

Now a got next error:

InvalidArgumentException: The plugin class WyriHaximus\TwigView\Plugin cannot be found. Ensure your autoloader is correct.

And I don't used this plugin before.

Also I used this release files for update deprecated code

How I can fix it, and what could provoke this problem?

Full error:

3) App\Test\TestCase\Controller\CardsControllerTest::testEditPostError
InvalidArgumentException: The plugin class `WyriHaximus\TwigView\Plugin` cannot be found. Ensure your autoloader is correct.

C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:127
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:95
C:\work\OSPanel\domains\project.loc\vendor\cakephp\bake\src\Plugin.php:50
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\BaseApplication.php:154
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\Server.php:124
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\Http\Server.php:82
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\MiddlewareDispatcher.php:149
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\IntegrationTestCase.php:495
C:\work\OSPanel\domains\project.loc\vendor\cakephp\cakephp\src\TestSuite\IntegrationTestCase.php:392
C:\work\OSPanel\domains\project.loc\tests\TestCase\Controller\CardsControllerTest.php:229

Thank you.

2
  • "Also I used this release files for update deprecated code" what do you mean with this? Did you follow the official migration guide?
    – Remul
    Jul 15, 2020 at 15:46
  • @Remul , in guide recommend for hide deprecated set 'errorLevel' => E_ALL ^ E_USER_DEPRECATED, but i want to replace this code to new. On Github i found answer witch recomend replace code to new from releases (bootsprap.php, webroot/index.php etc) with save my custom code.
    – AlzGamer
    Jul 16, 2020 at 5:48

1 Answer 1

0

Make sure you have removed/commented Plugin::routes(); line from your config/routes.php file.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.