1 | <?php |
||
22 | class RestTestCase extends GravitonTestCase |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * Create a REST Client. |
||
27 | * |
||
28 | * Creates a regular client first so we can profit from the bootstrapping code |
||
29 | * in parent::createClient and is otherwise API compatible with said method. |
||
30 | * |
||
31 | * @param array $options An array of options to pass to the createKernel class |
||
32 | * @param array $server An array of server parameters |
||
33 | * |
||
34 | * @return \Graviton\TestBundle\Client A Client instance |
||
35 | */ |
||
36 | protected static function createRestClient(array $options = [], array $server = array()) |
||
45 | |||
46 | /** |
||
47 | * test for content type based on classname based mapping |
||
48 | * |
||
49 | * @param string $contentType Expected Content-Type |
||
50 | * @param Response $response Response from client |
||
51 | * |
||
52 | * @return void |
||
53 | */ |
||
54 | public function assertResponseContentType($contentType, Response $response) |
||
62 | |||
63 | /** |
||
64 | * assertion for checking cors headers |
||
65 | * |
||
66 | * @param string $methods methods to check for |
||
67 | * @param object $response response to load headers from |
||
68 | * |
||
69 | * @return void |
||
70 | */ |
||
71 | public function assertCorsHeaders($methods, $response) |
||
76 | |||
77 | /** |
||
78 | * assert that putting a fetched resource fails |
||
79 | * |
||
80 | * @param string $url url |
||
81 | * @param Client $client client to use |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | public function assertPutFails($url, $client) |
||
94 | } |
||
95 |