Skip to content

Commit 285735d

Browse files
committed
Add tests for non-numeric ID in GET/PUT/DELETE for user
1 parent 45711d9 commit 285735d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/UserTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,25 @@ public function testGet()
260260
$this->assertEqualsFixture('get_user', $response->json());
261261
}
262262

263-
public function testGetWrongUrl()
263+
public function testGetIdParamAsString()
264264
{
265265
$response = $this->actingAs(self::$admin)->json('get', '/users/test');
266266

267267
$response->assertNotFound();
268+
}
269+
270+
public function testPutIdParamAsString()
271+
{
272+
$response = $this->actingAs(self::$admin)->json('put', '/users/test');
268273

269-
$response->assertJson(['error' => 'The route v0.1/users/test could not be found.']);
274+
$response->assertNotFound();
275+
}
276+
277+
public function testDeleteIdParamAsString()
278+
{
279+
$response = $this->actingAs(self::$admin)->json('delete', '/users/test');
280+
281+
$response->assertNotFound();
270282
}
271283

272284
public function testGetNotExists()

0 commit comments

Comments
 (0)