diff --git a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Compiler/DumpDataCollectorPass.php b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Compiler/DumpDataCollectorPass.php index 7562e7d44b3a..fae3177dfe4e 100644 --- a/src/Symfony/Bundle/DebugBundle/DependencyInjection/Compiler/DumpDataCollectorPass.php +++ b/src/Symfony/Bundle/DebugBundle/DependencyInjection/Compiler/DumpDataCollectorPass.php @@ -15,7 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; /** - * Registers the file link format for the {@link \Symfony\Component\HttpKernel\DataCollector\DumpDataCollector\DumpDataCollector}. + * Registers the file link format for the {@link \Symfony\Component\HttpKernel\DataCollector\DumpDataCollector}. * * @author Christian Flothmann */ diff --git a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php index b6ac24dafb9d..97a191307d3f 100644 --- a/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php @@ -73,7 +73,7 @@ public function provideClassNotFoundData() $symfonyAutoloader = new SymfonyClassLoader(); $symfonyAutoloader->addPrefixes($prefixes); - $debugClassLoader = new DebugClassLoader($symfonyAutoloader); + $debugClassLoader = new DebugClassLoader(array($symfonyAutoloader, 'loadClass')); return array( array( diff --git a/src/Symfony/Component/HttpKernel/HttpKernel.php b/src/Symfony/Component/HttpKernel/HttpKernel.php index 1fed81e7a78b..473f780ca3cb 100644 --- a/src/Symfony/Component/HttpKernel/HttpKernel.php +++ b/src/Symfony/Component/HttpKernel/HttpKernel.php @@ -229,10 +229,6 @@ private function handleException(\Exception $e, $request, $type) if (!$event->hasResponse()) { $this->finishRequest($request, $type); - if ($this->dispatcher->hasListeners(KernelEvents::EXCEPTION)) { - throw new \LogicException('No listeners of the "kernel.exception" event set a Response', 0, $e); - } - throw $e; } diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php index b793cf0f9e7e..242edeaa40e8 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php @@ -151,7 +151,7 @@ public function testHandleWhenNoControllerIsFound() $dispatcher = new EventDispatcher(); $kernel = new HttpKernel($dispatcher, $this->getResolver(false)); - $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, false); + $kernel->handle(new Request()); } /** diff --git a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php index 1afc22b27959..b8bb63b41649 100644 --- a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php @@ -37,7 +37,7 @@ public function validate($value, Constraint $constraint) throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Choice'); } - if (!$constraint->choices && !$constraint->callback) { + if (!is_array($constraint->choices) && !$constraint->callback) { throw new ConstraintDefinitionException('Either "choices" or "callback" must be specified on constraint Choice'); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php index 579d6aa90863..b515b843584a 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php @@ -150,6 +150,23 @@ public function testInvalidChoice() ->assertRaised(); } + public function testInvalidChoiceEmptyChoices() + { + $constraint = new Choice(array( + // May happen when the choices are provided dynamically, e.g. from + // the DB or the model + 'choices' => array(), + 'message' => 'myMessage', + )); + + $this->validator->validate('baz', $constraint); + + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"baz"') + ->setCode(Choice::NO_SUCH_CHOICE_ERROR) + ->assertRaised(); + } + public function testInvalidChoiceMultiple() { $constraint = new Choice(array(