From 982a06f303bffc103ccafe83e33e386df9c02c5d Mon Sep 17 00:00:00 2001 From: WouterJ <waldio.webdesign@gmail.com> Date: Thu, 26 Feb 2015 18:28:18 +0100 Subject: [PATCH] Installed PhpUnit Bridge to make deprecation testing easier --- Tests/Datagrid/ListMapperTest.php | 3 +++ Tests/Util/AdminObjectAclDataTest.php | 4 ++++ Tests/tests/bootstrap.php | 11 +++++++++++ composer.json | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Tests/Datagrid/ListMapperTest.php b/Tests/Datagrid/ListMapperTest.php index b6d821ac9a..cacac37a35 100644 --- a/Tests/Datagrid/ListMapperTest.php +++ b/Tests/Datagrid/ListMapperTest.php @@ -121,6 +121,9 @@ public function testAdd() $this->assertEquals('fooName', $fieldDescription->getOption('label')); } + /** + * @group legacy + */ public function testAddViewInlineActionException() { $this->setExpectedException('PHPUnit_Framework_Error', 'Inline action "view" is deprecated since version 2.2.4. Use inline action "show" instead.'); diff --git a/Tests/Util/AdminObjectAclDataTest.php b/Tests/Util/AdminObjectAclDataTest.php index 40e2c59b9b..41b6b3782c 100644 --- a/Tests/Util/AdminObjectAclDataTest.php +++ b/Tests/Util/AdminObjectAclDataTest.php @@ -119,6 +119,8 @@ public function testGetMasks() } /** + * @group legacy + * * @deprecated */ public function testSetForm() @@ -135,6 +137,8 @@ public function testSetForm() /** * @depends testSetForm * + * @group legacy + * * @deprecated */ public function testGetForm($adminObjectAclData) diff --git a/Tests/tests/bootstrap.php b/Tests/tests/bootstrap.php index 8cfacd69a4..80e015bdaa 100644 --- a/Tests/tests/bootstrap.php +++ b/Tests/tests/bootstrap.php @@ -17,3 +17,14 @@ } elseif (file_exists($file = __DIR__.'/autoload.php.dist')) { require_once $file; } + +// try to get Symfony's PHPunit Bridge +$files = array_filter(array( + __DIR__.'/../../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', + __DIR__.'/../../vendor/symfony/phpunit-bridge/bootstrap.php', + __DIR__.'/../../../../../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php', + __DIR__.'/../../../../../vendor/symfony/phpunit-bridge/bootstrap.php', +), 'file_exists'); +if ($files) { + require_once current($files); +} diff --git a/composer.json b/composer.json index d3861644a5..e317ab9373 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,8 @@ "require-dev": { "jms/translation-bundle": "~1.1", "symfony/yaml": "~2.3", - "sonata-project/intl-bundle": "~2.1" + "sonata-project/intl-bundle": "~2.1", + "symfony/phpunit-bridge": "2.7.*@dev" }, "suggest": { "jms/translation-bundle": "Extract message keys from Admins",