laravel fatal error for TestCase not found

前端 未结 8 1934
离开以前
离开以前 2021-02-12 13:26
http://localhost/laravel/app/tests/ExampleTest.php

if i run laravel it shows the following error

Fatal error: Class \'TestCase\' not found in D

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-12 13:37

    I got the same error but none worked,

    except for this one, this worked for me,

    I tried reinstalling and upgrading my phpunit in Laravel 5.4,

    1. modify compose.json -> find these line and change the phpunit version

      "require-dev": { "phpunit/phpunit": "~6.4" },

    2. after editing, run on your cmd,

      composer update

    3. then run

      composer dump-autoload

    4. php artisan config:clear

    5. php artisan cache:clear

    6. finally, run phpunit

    or run specific unit, phpunit --filter yourTestCaseClass

提交回复
热议问题