| 94 | | protected function assertResponseHasRedirect($expected, $message = '') |
| 95 | | { |
| 96 | | |
| 97 | | } |
| 98 | | |
| 99 | | protected function assertResponseHasHeader($expected, $expectedValue = null, $message = '') |
| 100 | | { |
| 101 | | |
| 102 | | } |
| 103 | | |
| 104 | | protected function assertResponseHasHTTPStatus($expected, $message = 'Failed asserting that the respons status is %1$s') |
| | 113 | protected function assertResponseHasRedirect($message = 'Failed asserting that the view redirects') |
| | 114 | { |
| | 115 | $response = $this->container->getResponse(); |
| | 116 | try { |
| | 117 | $this->assertTrue($response->hasRedirect(), $message); |
| | 118 | } catch (AgaviException $e) { |
| | 119 | $this->fail($message); |
| | 120 | } |
| | 121 | } |
| | 122 | |
| | 123 | protected function assertResponseHasNoRedirect($message = 'Failed asserting that the view does not redirect') |
| | 124 | { |
| | 125 | $response = $this->container->getResponse(); |
| | 126 | try { |
| | 127 | $this->assertFalse($response->hasRedirect(), $message); |
| | 128 | } catch (AgaviException $e) { |
| | 129 | $this->fail($message); |
| | 130 | } |
| | 131 | } |
| | 132 | |
| | 133 | protected function assertResponseRedirectsTo($expected, $message = 'Failed asserting that the view redirects to the given target.') |
| | 134 | { |
| | 135 | $response = $this->container->getResponse(); |
| | 136 | try { |
| | 137 | $this->assertEquals($expected, $response->getRedirect(), $message); |
| | 138 | } catch (AgaviException $e) { |
| | 139 | $this->fail($message); |
| | 140 | } |
| | 141 | } |
| | 142 | |
| | 143 | protected function assertResponseHasContentType($expected, $message = 'Failed asserting that the response content type is %1$s.') |
| | 150 | $this->assertEquals($expected, $response->getContentType(), sprintf($message, $expected)); |
| | 151 | } |
| | 152 | |
| | 153 | protected function assertResponseHasHeader($expected, $expectedValue = null, $message = 'Failed asserting that the response has a header named <%1$s> with the value <%2$s>') |
| | 154 | { |
| | 155 | $response = $this->container->getResponse(); |
| | 156 | |
| | 157 | if(!($response instanceof AgaviWebResponse)) { |
| | 158 | $this->fail(sprintf($message . ' (response is not an AgaviWebResponse)', $expected)); |
| | 159 | } |
| | 160 | $this->assertEquals($expected, $response->getHeader($expected), sprintf($message, $expected, $expectedValue)); |
| | 161 | } |
| | 162 | |
| | 163 | protected function assertResponseHasHTTPStatus($expected, $message = 'Failed asserting that the respons status is %1$s.') |
| | 164 | { |
| | 165 | $response = $this->container->getResponse(); |
| | 166 | |
| | 167 | if(!($response instanceof AgaviWebResponse)) { |
| | 168 | $this->fail(sprintf($message . ' (response is not an AgaviWebResponse)', $expected)); |
| | 169 | } |