@@ 397-411 (lines=15) @@ | ||
394 | /** |
|
395 | * @expectedException \Klein\Exceptions\UnhandledException |
|
396 | */ |
|
397 | public function testErrorsWithNoCallbacks() |
|
398 | { |
|
399 | $this->klein_app->respond( |
|
400 | function ($request, $response, $service) { |
|
401 | throw new Exception('testing'); |
|
402 | } |
|
403 | ); |
|
404 | ||
405 | $this->klein_app->dispatch(); |
|
406 | ||
407 | $this->assertSame( |
|
408 | 500, |
|
409 | $this->klein_app->response()->code() |
|
410 | ); |
|
411 | } |
|
412 | ||
413 | public function testSkipThis() |
|
414 | { |
@@ 2167-2179 (lines=13) @@ | ||
2164 | $this->assertSame(404, $this->klein_app->response()->code()); |
|
2165 | } |
|
2166 | ||
2167 | public function testMultipleUnsafeCharactersArentOverQuoted() |
|
2168 | { |
|
2169 | $this->klein_app->respond( |
|
2170 | '/[a:site].[:format]?/[:id].[:format2]?', |
|
2171 | function () { |
|
2172 | } |
|
2173 | ); |
|
2174 | ||
2175 | $this->klein_app->dispatch( |
|
2176 | MockRequestFactory::create('/site.main/id.json') |
|
2177 | ); |
|
2178 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2179 | } |
|
2180 | ||
2181 | public function testMatchesLiteralPlusSignsInPaths() |
|
2182 | { |
|
@@ 2202-2214 (lines=13) @@ | ||
2199 | $this->assertSame(404, $this->klein_app->response()->code()); |
|
2200 | } |
|
2201 | ||
2202 | public function testMatchesParenthesesInPaths() |
|
2203 | { |
|
2204 | $this->klein_app->respond( |
|
2205 | '/test(bar)', |
|
2206 | function () { |
|
2207 | } |
|
2208 | ); |
|
2209 | ||
2210 | $this->klein_app->dispatch( |
|
2211 | MockRequestFactory::create('/test(bar)') |
|
2212 | ); |
|
2213 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2214 | } |
|
2215 | ||
2216 | public function testMatchesAdvancedRegularExpressions() |
|
2217 | { |
|
@@ 2216-2228 (lines=13) @@ | ||
2213 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2214 | } |
|
2215 | ||
2216 | public function testMatchesAdvancedRegularExpressions() |
|
2217 | { |
|
2218 | $this->klein_app->respond( |
|
2219 | '@^/foo.../bar$', |
|
2220 | function () { |
|
2221 | } |
|
2222 | ); |
|
2223 | ||
2224 | $this->klein_app->dispatch( |
|
2225 | MockRequestFactory::create('/foooom/bar') |
|
2226 | ); |
|
2227 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2228 | } |
|
2229 | ||
2230 | public function testApcDependencyFailsGracefully() |
|
2231 | { |
|
@@ 2230-2245 (lines=16) @@ | ||
2227 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2228 | } |
|
2229 | ||
2230 | public function testApcDependencyFailsGracefully() |
|
2231 | { |
|
2232 | // Custom apc function |
|
2233 | implement_custom_apc_cache_functions(); |
|
2234 | ||
2235 | $this->klein_app->respond( |
|
2236 | '/test', |
|
2237 | function () { |
|
2238 | } |
|
2239 | ); |
|
2240 | ||
2241 | $this->klein_app->dispatch( |
|
2242 | MockRequestFactory::create('/test') |
|
2243 | ); |
|
2244 | $this->assertSame(200, $this->klein_app->response()->code()); |
|
2245 | } |
|
2246 | ||
2247 | public function testRoutePathCompilationFailure() |
|
2248 | { |