Using phpunit command Laravel will run all unit tests in our project.
How to run one or specific Unit Tests in Laravel 5.1?
I just want to run testFindToken from my test suite.
<?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);
}
}