:
Test , First.php, FirstTest.php;
test , getuser, testGetuser, , @test ;
public;
PHPUnit\Framework\TestCase。
:
php artisan make:test UserTest # Feature -- --> laravel
php artisan make:test UserTest --unit # Unit -- --> phpunit
, :
php artisan config:clear
:
./vendor/bin/phpunit
:
./vendor/bin/phpunit tests/Unit/ExampleTest.php
, tests/Unit :
./vendor/bin/phpunit --testsuite=Unit
:
./vendor/bin/phpunit --coverage-html . # HTML index.html ,[ ??]
https://xueyuanjun.com/post/19586.html
:https://phpunit.readthedocs.io/zh_CN/latest/assertions.html