diff --git a/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php b/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php index 457532ecd5..35dcb40b62 100644 --- a/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php +++ b/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php @@ -12,7 +12,7 @@ namespace Symfony\Bridge\Twig\Node; /** - * Compiles a call to {@link FormRendererInterface::renderBlock()}. + * Compiles a call to {@link \Symfony\Component\Form\FormRendererInterface::renderBlock()}. * * The function name is used as block name. For example, if the function name * is "foo", the block "foo" will be rendered. diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php index 2df09ce1a6..ab4b7fc7da 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Translation; use Symfony\Bundle\FrameworkBundle\Translation\Translator; +use Symfony\Component\Translation\Loader\ArrayLoader; use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Translation\MessageSelector; @@ -77,6 +78,8 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase // do it another time as the cache is primed now $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); + $loader->expects($this->never())->method('load'); + $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir)); $translator->setLocale('fr'); $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR', 'fr.UTF-8', 'sr@latin')); @@ -90,6 +93,27 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase $this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1)); $this->assertEquals('foobarbaz (fr.UTF-8)', $translator->trans('foobarbaz')); $this->assertEquals('foobarbax (sr@latin)', $translator->trans('foobarbax')); + + // refresh cache again when resource file resources file change + $resource = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); + $resource + ->expects($this->at(0)) + ->method('isFresh') + ->will($this->returnValue(false)) + ; + $catalogue = $this->getCatalogue('fr', array('foo' => 'foo fresh')); + $catalogue->addResource($resource); + + $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); + $loader + ->expects($this->at(0)) + ->method('load') + ->will($this->returnValue($catalogue)) + ; + + $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir)); + $translator->setLocale('fr'); + $this->assertEquals('foo fresh', $translator->trans('foo')); } public function testTransWithCachingWithInvalidLocale() @@ -184,12 +208,7 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase public function getTranslator($loader, $options = array(), $translatorClass = '\Symfony\Bundle\FrameworkBundle\Translation\Translator') { - $translator = new $translatorClass( - $this->getContainer($loader), - new MessageSelector(), - array('loader' => array('loader')), - $options - ); + $translator = $this->createTranslator($loader, $options, $translatorClass); $translator->addResource('loader', 'foo', 'fr'); $translator->addResource('loader', 'foo', 'en'); @@ -201,6 +220,18 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase return $translator; } + + private function createTranslator($loader, $options, $translatorClass = '\Symfony\Bundle\FrameworkBundle\Translation\Translator') + { + $translator = new $translatorClass( + $this->getContainer($loader), + new MessageSelector(), + array('loader' => array('loader')), + $options + ); + + return $translator; + } } class TranslatorWithInvalidLocale extends Translator diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig index ff90d27b9a..da791b1fec 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/time.html.twig @@ -103,13 +103,13 @@ return dict.hasOwnProperty(key) ? dict[key] : null; - } + }; this.set = function(key, value) { dict[key] = value; return value; - } + }; }; /** @@ -383,7 +383,7 @@ return this; }; - }; + } function canvasAutoUpdateOnResizeAndSubmit(e) { e.preventDefault(); diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig index 7a3938e4f5..2cd8955b12 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/layout.html.twig @@ -121,7 +121,7 @@ for (elem in menuItems) { if (typeof(menuItems[elem].children) !== 'undefined' && menuItems[elem].children.length > 0) { - child = menuItems[elem].children[0] + child = menuItems[elem].children[0]; if ('' === child.getAttribute('title') || null === child.getAttribute('title')) { diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php index f0d8ec44d4..2e08f5dd57 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php @@ -127,7 +127,7 @@ interface ChoiceListInterface * Returns the indices corresponding to the given choices. * * The indices must be positive integers or strings accepted by - * {@link FormConfigBuilder::validateName()}. + * {@link \Symfony\Component\Form\FormConfigBuilder::validateName()}. * * The index "placeholder" is internally reserved. * @@ -147,7 +147,7 @@ interface ChoiceListInterface * Returns the indices corresponding to the given values. * * The indices must be positive integers or strings accepted by - * {@link FormConfigBuilder::validateName()}. + * {@link \Symfony\Component\Form\FormConfigBuilder::validateName()}. * * The index "placeholder" is internally reserved. * diff --git a/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php b/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php index e9b733cf8a..1835fcd5c5 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/BaseType.php @@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolverInterface; * Encapsulates common logic of {@link FormType} and {@link ButtonType}. * * This type does not appear in the form's type inheritance chain and as such - * cannot be extended (via {@link FormTypeExtension}s) nor themed. + * cannot be extended (via {@link \Symfony\Component\Form\FormExtensionInterface}) nor themed. * * @author Bernhard Schussek */ diff --git a/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php b/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php index bb144ed65a..2489cf371c 100644 --- a/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php +++ b/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; * @author Bernhard Schussek * * @deprecated Deprecated since version 2.3, to be removed in 3.0. Pass the - * Request instance to {@link Form::handleRequest()} instead. + * Request instance to {@link \Symfony\Component\Form\Form::handleRequest()} instead. */ class BindRequestListener implements EventSubscriberInterface { diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php index 8e406a9b08..c84f98a200 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php @@ -48,7 +48,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface /** * Creates a new violation path from a string. * - * @param string $violationPath The property path of a {@link ConstraintViolation} + * @param string $violationPath The property path of a {@link \Symfony\Component\Validator\ConstraintViolation} * object. */ public function __construct($violationPath) diff --git a/src/Symfony/Component/Form/NativeRequestHandler.php b/src/Symfony/Component/Form/NativeRequestHandler.php index 7c883f12eb..c9a76858dd 100644 --- a/src/Symfony/Component/Form/NativeRequestHandler.php +++ b/src/Symfony/Component/Form/NativeRequestHandler.php @@ -159,7 +159,7 @@ class NativeRequestHandler implements RequestHandlerInterface * It's safe to pass an already converted array, in which case this method * just returns the original array unmodified. * - * This method is identical to {@link Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray} + * This method is identical to {@link \Symfony\Component\HttpFoundation\FileBag::fixPhpFilesArray} * and should be kept as such in order to port fixes quickly and easily. * * @param array $data diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php index 700b111228..43a4478ebd 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php @@ -26,7 +26,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase /** * @expectedException \RuntimeException */ - public function testHandleWhenControllerThrowsAnExceptionAndRawIsTrue() + public function testHandleWhenControllerThrowsAnExceptionAndCatchIsTrue() { $kernel = new HttpKernel(new EventDispatcher(), $this->getResolver(function () { throw new \RuntimeException(); })); @@ -36,14 +36,14 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase /** * @expectedException \RuntimeException */ - public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalseAndNoListenerIsRegistered() + public function testHandleWhenControllerThrowsAnExceptionAndCatchIsFalseAndNoListenerIsRegistered() { $kernel = new HttpKernel(new EventDispatcher(), $this->getResolver(function () { throw new \RuntimeException(); })); $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, false); } - public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse() + public function testHandleWhenControllerThrowsAnExceptionAndCatchIsTrueWithAHandlingListener() { $dispatcher = new EventDispatcher(); $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) { @@ -51,12 +51,26 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase }); $kernel = new HttpKernel($dispatcher, $this->getResolver(function () { throw new \RuntimeException('foo'); })); - $response = $kernel->handle(new Request()); + $response = $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true); $this->assertEquals('500', $response->getStatusCode()); $this->assertEquals('foo', $response->getContent()); } + /** + * @expectedException \RuntimeException + */ + public function testHandleWhenControllerThrowsAnExceptionAndCatchIsTrueWithANonHandlingListener() + { + $dispatcher = new EventDispatcher(); + $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) { + // should set a response, but does not + }); + + $kernel = new HttpKernel($dispatcher, $this->getResolver(function () { throw new \RuntimeException('foo'); })); + $kernel->handle(new Request(), HttpKernelInterface::MASTER_REQUEST, true); + } + public function testHandleExceptionWithARedirectionResponse() { $dispatcher = new EventDispatcher(); diff --git a/src/Symfony/Component/Validator/DefaultTranslator.php b/src/Symfony/Component/Validator/DefaultTranslator.php index 06967de922..63fa09efd7 100644 --- a/src/Symfony/Component/Validator/DefaultTranslator.php +++ b/src/Symfony/Component/Validator/DefaultTranslator.php @@ -88,7 +88,7 @@ class DefaultTranslator implements TranslatorInterface * have the same expressiveness. While Translator supports intervals in * message translations, which are needed for languages other than English, * this translator does not. You should use Translator or a custom - * implementation of {@link TranslatorInterface} if you need this or similar + * implementation of {@link \Symfony\Component\Translation\TranslatorInterface} if you need this or similar * functionality. * * Example usage: