markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); $response = $this->actingAs($user)->delete(route('posts.destroy', ['id' => $post->id])); $response->assertOk(); $this->assertModelMissing($post); // TODO: perform additional assertions }); test('destroy aborts with a 403', function (): void { $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); // TODO: perform additional setup to trigger `abort_unless(403)`... $response = $this->actingAs($user)->delete(route('posts.destroy', ['id' => $post->id])); $response->assertForbidden(); }); test('edit 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.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); $response = $this->actingAs($user)->get(route('posts.edit', ['id' => $post->id])); $response->assertOk(); $response->assertViewIs('forum.post.edit'); $response->assertViewHas('topic'); $response->assertViewHas('forum'); $response->assertViewHas('post', $post); $response->assertViewHas('category'); // TODO: perform additional assertions }); test('edit aborts with a 403', function (): void { $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); // TODO: perform additional setup to trigger `abort_unless(403)`... $response = $this->actingAs($user)->get(route('posts.edit', ['id' => $post->id])); $response->assertForbidden(); }); 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.'); $user = \App\Models\User::factory()->create(); $response = $this->actingAs($user)->get(route('posts.index')); $response->assertOk(); $response->assertViewIs('forum.post.index'); // TODO: perform additional assertions }); test('store 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.'); $topic = \App\Models\Topic::factory()->create(); $users = \App\Models\User::factory()->times(3)->create(); $user = \App\Models\User::factory()->create(); $response = $this->actingAs($user)->post(route('posts.store'), [ // TODO: send request data ]); $response->assertRedirect(withSuccess(trans('forum.reply-topic-success'))); // TODO: perform additional assertions }); test('update 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.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); $response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [ // TODO: send request data ]); $response->assertRedirect(withSuccess(trans('forum.edit-post-success'))); // TODO: perform additional assertions }); test('update aborts with a 403', function (): void { $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); // TODO: perform additional setup to trigger `abort_unless(403)`... $response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [ // TODO: send request data ]); $response->assertForbidden(); }); test('update aborts with a 403', function (): void { $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); $post = \App\Models\Post::factory()->create(); $user = \App\Models\User::factory()->create(); // TODO: perform additional setup to trigger `abort_unless(403)`... $response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [ // TODO: send request data ]); $response->assertForbidden(); }); // test cases...