mirror of
https://github.com/BillyOutlast/UNIT3D.git
synced 2026-02-10 14:10:55 +01:00
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('index returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$articles = \App\Models\Article::factory()->times(3)->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('articles.index'));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('article.index');
|
|
$response->assertViewHas('articles', $articles);
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('show returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$article = \App\Models\Article::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get(route('articles.show', [$article]));
|
|
|
|
$response->assertOk();
|
|
$response->assertViewIs('article.show');
|
|
$response->assertViewHas('article', $article);
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
// test cases...
|