Mit phpunit
Befehl Laravel wird alle Komponententests in unserem Projekt ausführen. Wie führe ich einen oder bestimmte Unit Tests unter Laravel 5.1
aus?Führen Sie nur einen Einheitentest aus einer Testsuite in Laravel
Ich möchte nur aus meiner Testsuite ausführen.
<?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);
}
}
Great! Danke Zayn :) –