Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Nov 30, 2022
1 parent 6674a87 commit ed566a6
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions tests/Integration/Routing/RouteSingletonTest.php
Expand Up @@ -135,9 +135,9 @@ public function testSingletonExcept()
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton update', $response->getContent());

$response = $this->delete('/avatar');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton destroy', $response->getContent());
// $response = $this->delete('/avatar');
// $this->assertEquals(200, $response->getStatusCode());
// $this->assertSame('singleton destroy', $response->getContent());
}

public function testSingletonName()
Expand Down Expand Up @@ -174,6 +174,30 @@ public function testNestedSingleton()
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton update for 123', $response->getContent());

$response = $this->delete('/videos/123/thumbnail');
$this->assertEquals(405, $response->getStatusCode());
}

public function testCreatableNestedSingleton()
{
Route::singleton('videos.thumbnail', NestedSingletonTestController::class)->creatable();

$response = $this->get('/videos/123/thumbnail');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton show for 123', $response->getContent());

$response = $this->get('/videos/123/thumbnail/edit');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton edit for 123', $response->getContent());

$response = $this->put('/videos/123/thumbnail');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton update for 123', $response->getContent());

$response = $this->patch('/videos/123/thumbnail');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton update for 123', $response->getContent());

$response = $this->delete('/videos/123/thumbnail');
$this->assertEquals(200, $response->getStatusCode());
$this->assertSame('singleton destroy for 123', $response->getContent());
Expand Down

0 comments on commit ed566a6

Please sign in to comment.