在 laravel 中仅从测试套件中运行一个单元测试
使用命令Laravel将运行我们项目中的所有单元测试。如何在 ?phpunit
Laravel 5.1
我只想从我的测试套件运行。testFindToken
<?php
use Mockery as m;
use App\Models\AccessToken;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class AccessTokenRepositoryTest extends TestCase
{
use WithoutMiddleware;
public function setUp()
{
parent::setUp();
$this->accessToken = factory(AccessToken::class);
$this->repo_AccessToken = app()->make('App\Repositories\AccessTokenRepository');
}
public function testFindToken()
{
$model = $this->accessToken->make();
$model->save();
$model_accessToken = $this->repo_AccessToken->findToken($model->id);
$this->assertInstanceOf(Illuminate\Database\Eloquent\Model::class, $model);
$this->assertNotNull(true, $model_accessToken);
}
}