|
@@ 17-23 (lines=7) @@
|
| 14 |
|
]); |
| 15 |
|
} |
| 16 |
|
|
| 17 |
|
public function testControllerGET() { |
| 18 |
|
$id = 'Foo'; |
| 19 |
|
$result = $this->makeApiRequest("RestTestRoute/$id/Nested"); |
| 20 |
|
$this->assertTrue(array_key_exists('message', $result)); |
| 21 |
|
$this->assertEquals('Test GET', $result['message']); |
| 22 |
|
$this->assertEquals($id, $result['resource']['id']); |
| 23 |
|
} |
| 24 |
|
|
| 25 |
|
public function testNotProvidedID() { |
| 26 |
|
$this->makeApiRequest("RestTestRoute//Nested", ['code' => 404]); |
|
@@ 30-36 (lines=7) @@
|
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
|
| 30 |
|
public function testControllerDELETE() { |
| 31 |
|
$id = 'Bar'; |
| 32 |
|
$result = $this->makeApiRequest("RestTestRoute/$id/Nested", ['method' => 'DELETE']); |
| 33 |
|
$this->assertTrue(array_key_exists('message', $result)); |
| 34 |
|
$this->assertEquals('Test DELETE', $result['message']); |
| 35 |
|
$this->assertEquals($id, $result['resource']['id']); |
| 36 |
|
} |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
class NestedTestController extends NestedResourceRestController implements \TestOnly { |