diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index bb625fb..10e6084 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -21,8 +21,6 @@ */ class Configuration implements ConfigurationInterface { - const EXCEPTION_STRATEGY_NONE = false; - const EXCEPTION_STRATEGY_TO_HTTP_NOT_FOUND = 'to_http_not_found'; /** @@ -41,12 +39,12 @@ public function getConfigTreeBuilder() ->arrayNode('exceptions_strategy') ->addDefaultsIfNotSet() ->children() - ->scalarNode('out_of_range_page')->defaultValue(self::EXCEPTION_STRATEGY_NONE)->end() - ->scalarNode('not_valid_current_page')->defaultValue(self::EXCEPTION_STRATEGY_NONE)->end() + ->scalarNode('out_of_range_page')->defaultValue(self::EXCEPTION_STRATEGY_TO_HTTP_NOT_FOUND)->end() + ->scalarNode('not_valid_current_page')->defaultValue(self::EXCEPTION_STRATEGY_TO_HTTP_NOT_FOUND)->end() ->end() ->end() ->end(); return $treeBuilder; } -} \ No newline at end of file +} diff --git a/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Tests/Controller/PagerfantaControllerTest.php b/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Tests/Controller/PagerfantaControllerTest.php index e3e76df..600a1c7 100644 --- a/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Tests/Controller/PagerfantaControllerTest.php +++ b/TestsProject/src/WhiteOctober/PagerfantaTestBundle/Tests/Controller/PagerfantaControllerTest.php @@ -188,7 +188,7 @@ public function testOutOfRangeExceptionWithNoneStrategy() $client->request('GET', $this->buildViewUrl('custom-page?currentPage=51')); $response = $client->getResponse(); - $this->assertSame(500, $response->getStatusCode()); + $this->assertSame(404, $response->getStatusCode()); } /** @@ -221,7 +221,7 @@ public function testWrongMaxPerPageExceptionWithNoneStrategy() $client->request('GET', $this->buildViewUrl('custom-page?maxPerPage=invalid')); $response = $client->getResponse(); - $this->assertSame(500, $response->getStatusCode()); + $this->assertSame(404, $response->getStatusCode()); } /**