src/Graviton/CoreBundle/Tests/Controller/MainControllerTest.php 2 locations
|
@@ 64-75 (lines=12) @@
|
| 61 |
|
* |
| 62 |
|
* @return void |
| 63 |
|
*/ |
| 64 |
|
public function testAppsLink() |
| 65 |
|
{ |
| 66 |
|
$client = static::createRestClient(); |
| 67 |
|
$client->request('GET', '/'); |
| 68 |
|
|
| 69 |
|
$response = $client->getResponse(); |
| 70 |
|
|
| 71 |
|
$this->assertContains( |
| 72 |
|
'<http://localhost/core/app/>; rel="apps"; type="application/json"', |
| 73 |
|
$response->headers->get('Link') |
| 74 |
|
); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
/** |
| 78 |
|
* check for response contents. |
|
@@ 248-259 (lines=12) @@
|
| 245 |
|
/** |
| 246 |
|
* @return void |
| 247 |
|
*/ |
| 248 |
|
public function testOptionsResponse() |
| 249 |
|
{ |
| 250 |
|
$client = static::createRestClient(); |
| 251 |
|
$client->request('OPTIONS', '/'); |
| 252 |
|
|
| 253 |
|
$response = $client->getResponse(); |
| 254 |
|
|
| 255 |
|
$this->assertContains( |
| 256 |
|
'If-None-Match', |
| 257 |
|
$response->headers->get('Access-Control-Allow-Headers') |
| 258 |
|
); |
| 259 |
|
} |
| 260 |
|
} |
| 261 |
|
|
src/Graviton/CoreBundle/Tests/Controller/ProductControllerTest.php 1 location
|
@@ 113-126 (lines=14) @@
|
| 110 |
|
* |
| 111 |
|
* @return void |
| 112 |
|
*/ |
| 113 |
|
public function testGetProductSchemaInformation() |
| 114 |
|
{ |
| 115 |
|
$client = static::createRestClient(); |
| 116 |
|
$client->request('OPTIONS', '/core/product/1'); |
| 117 |
|
|
| 118 |
|
$response = $client->getResponse(); |
| 119 |
|
|
| 120 |
|
$this->assertCorsHeaders('GET, OPTIONS', $response); |
| 121 |
|
|
| 122 |
|
$this->assertContains( |
| 123 |
|
'<http://localhost/core/product/1>; rel="self"', |
| 124 |
|
explode(',', $response->headers->get('Link')) |
| 125 |
|
); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
/** |
| 129 |
|
* test getting schema information from canonical url |
src/Graviton/SecurityBundle/Tests/Controller/WhoAmIControllerTest.php 1 location
|
@@ 25-33 (lines=9) @@
|
| 22 |
|
* |
| 23 |
|
* @return void |
| 24 |
|
*/ |
| 25 |
|
public function testWhoAmIAction() |
| 26 |
|
{ |
| 27 |
|
$client = static::createRestClient(); |
| 28 |
|
$client->request('GET', '/person/whoami/'); |
| 29 |
|
$response = $client->getResponse(); |
| 30 |
|
|
| 31 |
|
$this->assertContains('"username":', $response->getContent()); |
| 32 |
|
$this->assertInternalType('string', $response->getContent()); |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
/** |
| 36 |
|
* Tests if schema returns the right values |
src/Graviton/CoreBundle/Tests/Controller/RequiredHashControllerTest.php 1 location
|
@@ 306-315 (lines=10) @@
|
| 303 |
|
* |
| 304 |
|
* @return void |
| 305 |
|
*/ |
| 306 |
|
public function testCollectionHasNoRealId() |
| 307 |
|
{ |
| 308 |
|
$client = static::createRestclient(); |
| 309 |
|
$client->request('GET', '/schema/testcase/requiredhash/collection'); |
| 310 |
|
|
| 311 |
|
$response = $client->getResponse(); |
| 312 |
|
|
| 313 |
|
$this->assertEquals(Response::HTTP_OK, $response->getStatusCode()); |
| 314 |
|
$this->assertNotContains('realId', $response->getContent()); |
| 315 |
|
} |
| 316 |
|
} |
| 317 |
|
|