1 | <?php |
||
22 | class RestTestCase extends GravitonTestCase |
||
23 | { |
||
24 | /** |
||
25 | * Create a REST Client. |
||
26 | * |
||
27 | * Creates a regular client first so we can profit from the bootstrapping code |
||
28 | * in parent::createClient and is otherwise API compatible with said method. |
||
29 | * |
||
30 | * @param array $options An array of options to pass to the createKernel class |
||
31 | * @param array $server An array of server parameters |
||
32 | * |
||
33 | * @return \Graviton\TestBundle\Client A Client instance |
||
34 | */ |
||
35 | protected static function createRestClient(array $options = array(), array $server = array()) |
||
44 | |||
45 | /** |
||
46 | * load fixtures |
||
47 | * |
||
48 | * @return void |
||
49 | */ |
||
50 | public function setUp() |
||
61 | |||
62 | /** |
||
63 | * test for content type based on classname based mapping |
||
64 | * |
||
65 | * @param string $contentType Expected Content-Type |
||
66 | * @param Response $response Response from client |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | public function assertResponseContentType($contentType, Response $response) |
||
78 | |||
79 | /** |
||
80 | * assertion for checking cors headers |
||
81 | * |
||
82 | * @param string $methods methods to check for |
||
83 | * @param object $response response to load headers from |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | public function assertCorsHeaders($methods, $response) |
||
92 | |||
93 | /** |
||
94 | * assert that putting a fetched resource fails |
||
95 | * |
||
96 | * @param string $url url |
||
97 | * @param Client $client client to use |
||
98 | * |
||
99 | * @return void |
||
100 | */ |
||
101 | public function assertPutFails($url, $client) |
||
110 | |||
111 | /** |
||
112 | * Testing private methods for a class. |
||
113 | * |
||
114 | * $class = new YourClass(); or service... |
||
115 | * $method = $this->getPrivateClassMethod(get_class($class), 'getPrivateFunction'); |
||
116 | * $result = $method->invokeArgs( $this->activityManager, [argument1, argument2, ...]); |
||
117 | * |
||
118 | * @param string $className String name for class, full namespace. |
||
119 | * @param string $methodName Method name to be used |
||
120 | * @return \ReflectionMethod |
||
121 | */ |
||
122 | 2 | public function getPrivateClassMethod($className, $methodName) |
|
129 | } |
||
130 |