From 8bad61daf5c9ad9a6ac2cd3b15ac74604c6aa59e Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Tue, 24 Sep 2013 12:40:06 +0200 Subject: [PATCH 1/3] [HttpKernel] fix usage of deprecated FlattenException --- .../TwigBundle/Controller/ExceptionController.php | 2 +- .../Tests/Controller/ExceptionControllerTest.php | 2 +- .../DataCollector/ExceptionDataCollector.php | 2 +- .../HttpKernel/EventListener/ExceptionListener.php | 2 +- .../DataCollector/ExceptionDataCollectorTest.php | 13 ++++++------- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index 5a52791966..3abc2a92ea 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -12,7 +12,7 @@ namespace Symfony\Bundle\TwigBundle\Controller; use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; -use Symfony\Component\HttpKernel\Exception\FlattenException; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php index 18523eaa76..20646f74aa 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php @@ -19,7 +19,7 @@ class ExceptionControllerTest extends TestCase { public function testOnlyClearOwnOutputBuffers() { - $flatten = $this->getMock('Symfony\Component\HttpKernel\Exception\FlattenException'); + $flatten = $this->getMock('Symfony\Component\Debug\Exception\FlattenException'); $flatten ->expects($this->once()) ->method('getStatusCode') diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php index 10a010bc62..1b6d78240c 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ExceptionDataCollector.php @@ -11,9 +11,9 @@ namespace Symfony\Component\HttpKernel\DataCollector; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\Exception\FlattenException; /** * ExceptionDataCollector. diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php index 55950b29ed..ea957a5fe9 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -12,11 +12,11 @@ namespace Symfony\Component\HttpKernel\EventListener; use Psr\Log\LoggerInterface; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php index 54a8aabe67..8dd5abffdf 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php @@ -11,8 +11,8 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; +use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector; -use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -37,11 +37,10 @@ class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase $c->collect(new Request(), new Response(),$e); $this->assertTrue($c->hasException()); - $this->assertEquals($flattened,$c->getException()); - $this->assertSame('foo',$c->getMessage()); - $this->assertSame(500,$c->getCode()); - $this->assertSame('exception',$c->getName()); - $this->assertSame($trace,$c->getTrace()); + $this->assertEquals($flattened, $c->getException()); + $this->assertSame('foo', $c->getMessage()); + $this->assertSame(500, $c->getCode()); + $this->assertSame('exception', $c->getName()); + $this->assertSame($trace, $c->getTrace()); } - } From 50ff35a49b41ed3b67492b71dd444b55f52c00da Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Tue, 24 Sep 2013 19:21:01 +0100 Subject: [PATCH 2/3] Fixed an entity class name. Broken in #7940. --- .../Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index 1505bf8215..ab8d75b46d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -12,7 +12,7 @@ namespace Symfony\Bridge\Doctrine\Tests\Form\Type; use Symfony\Component\Form\Tests\FormPerformanceTestCase; -use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity; +use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity; use Doctrine\ORM\Tools\SchemaTool; use Symfony\Bridge\Doctrine\Tests\DoctrineOrmTestCase; use Symfony\Component\Form\Extension\Core\CoreExtension; @@ -23,7 +23,7 @@ use Symfony\Bridge\Doctrine\Form\DoctrineOrmExtension; */ class EntityTypePerformanceTest extends FormPerformanceTestCase { - const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity'; + const ENTITY_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity'; /** * @var \Doctrine\ORM\EntityManager From bcbe8d2d486d2fbd5b2850a9016ea28c325517a0 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Thu, 12 Sep 2013 22:41:34 +0100 Subject: [PATCH 3/3] Run all tests in parallel. --- .travis.yml | 5 +++++ .../Component/Console/Tests/Helper/DialogHelperTest.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index cb5f0ac5f2..01b2b54276 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,13 @@ php: - 5.5 before_script: + - sudo apt-get install parallel - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' - COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install - php src/Symfony/Component/Locale/Resources/data/build-data.php - export USE_INTL_ICU_DATA_VERSION=1 + +script: + - ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo "Running {} tests"; phpunit --exclude-group tty,benchmark {};' || exit 1 + - echo "Running tests requiring tty"; phpunit --group tty diff --git a/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php index e6418ad710..eba61c3e52 100644 --- a/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php @@ -87,6 +87,9 @@ class DialogHelperTest extends \PHPUnit_Framework_TestCase $this->assertEquals('FooBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles)); } + /** + * @group tty + */ public function testAskHiddenResponse() { if (defined('PHP_WINDOWS_VERSION_BUILD')) {