@@ -135,9 +135,9 @@ public function testSingletonExcept()
135
135
$ this ->assertEquals (200 , $ response ->getStatusCode ());
136
136
$ this ->assertSame ('singleton update ' , $ response ->getContent ());
137
137
138
- $ response = $ this ->delete ('/avatar ' );
139
- $ this ->assertEquals (200 , $ response ->getStatusCode ());
140
- $ this ->assertSame ('singleton destroy ' , $ response ->getContent ());
138
+ // $response = $this->delete('/avatar');
139
+ // $this->assertEquals(200, $response->getStatusCode());
140
+ // $this->assertSame('singleton destroy', $response->getContent());
141
141
}
142
142
143
143
public function testSingletonName ()
@@ -174,6 +174,30 @@ public function testNestedSingleton()
174
174
$ this ->assertEquals (200 , $ response ->getStatusCode ());
175
175
$ this ->assertSame ('singleton update for 123 ' , $ response ->getContent ());
176
176
177
+ $ response = $ this ->delete ('/videos/123/thumbnail ' );
178
+ $ this ->assertEquals (405 , $ response ->getStatusCode ());
179
+ }
180
+
181
+ public function testCreatableNestedSingleton ()
182
+ {
183
+ Route::singleton ('videos.thumbnail ' , NestedSingletonTestController::class)->creatable ();
184
+
185
+ $ response = $ this ->get ('/videos/123/thumbnail ' );
186
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
187
+ $ this ->assertSame ('singleton show for 123 ' , $ response ->getContent ());
188
+
189
+ $ response = $ this ->get ('/videos/123/thumbnail/edit ' );
190
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
191
+ $ this ->assertSame ('singleton edit for 123 ' , $ response ->getContent ());
192
+
193
+ $ response = $ this ->put ('/videos/123/thumbnail ' );
194
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
195
+ $ this ->assertSame ('singleton update for 123 ' , $ response ->getContent ());
196
+
197
+ $ response = $ this ->patch ('/videos/123/thumbnail ' );
198
+ $ this ->assertEquals (200 , $ response ->getStatusCode ());
199
+ $ this ->assertSame ('singleton update for 123 ' , $ response ->getContent ());
200
+
177
201
$ response = $ this ->delete ('/videos/123/thumbnail ' );
178
202
$ this ->assertEquals (200 , $ response ->getStatusCode ());
179
203
$ this ->assertSame ('singleton destroy for 123 ' , $ response ->getContent ());
0 commit comments