Created
September 17, 2019 12:06
-
-
Save minthemiddle/47691999632a2ee85cbfc962bd03849b to your computer and use it in GitHub Desktop.
Laravel Test Stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
use App\User; | |
class ExampleTest extends TestCase | |
{ | |
use RefreshDatabase; | |
/** @test */ | |
public function testExample() | |
{ | |
$this->withoutExceptionHandling(); | |
$this->markTestIncomplete(); | |
$response = $this->get('/'); | |
$response->assertStatus(200); | |
} | |
/** @test */ | |
public function testExampleWithVerifiedUser() | |
{ | |
$this->withoutExceptionHandling(); | |
$this->markTestIncomplete(); | |
$user = factory(User::class)->make(); | |
$response = $this->actingAs('user')->get('/'); | |
$response->assertStatus(200); | |
} | |
/** @test */ | |
public function testExampleWithUnverifiedUser() | |
{ | |
$this->withoutExceptionHandling(); | |
$this->markTestIncomplete(); | |
$user = factory(User::class)->make([ | |
'email_verified_at' => null, | |
]); | |
$response = $this->actingAs('user')->get('/'); | |
$response->assertStatus(200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
php artisan make:test
usesFeatures
/** @test */
by default