Преглед на файлове

Installed PhpUnit Bridge to make deprecation testing easier

WouterJ преди 10 години
родител
ревизия
982a06f303
променени са 4 файла, в които са добавени 20 реда и са изтрити 1 реда
  1. 3 0
      Tests/Datagrid/ListMapperTest.php
  2. 4 0
      Tests/Util/AdminObjectAclDataTest.php
  3. 11 0
      Tests/tests/bootstrap.php
  4. 2 1
      composer.json

+ 3 - 0
Tests/Datagrid/ListMapperTest.php

@@ -121,6 +121,9 @@ class ListMapperTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('fooName', $fieldDescription->getOption('label'));
         $this->assertEquals('fooName', $fieldDescription->getOption('label'));
     }
     }
 
 
+    /**
+     * @group legacy
+     */
     public function testAddViewInlineActionException()
     public function testAddViewInlineActionException()
     {
     {
         $this->setExpectedException('PHPUnit_Framework_Error', 'Inline action "view" is deprecated since version 2.2.4. Use inline action "show" instead.');
         $this->setExpectedException('PHPUnit_Framework_Error', 'Inline action "view" is deprecated since version 2.2.4. Use inline action "show" instead.');

+ 4 - 0
Tests/Util/AdminObjectAclDataTest.php

@@ -119,6 +119,8 @@ class AdminObjectAclDataTest extends \PHPUnit_Framework_TestCase
     }
     }
 
 
     /**
     /**
+     * @group legacy
+     *
      * @deprecated
      * @deprecated
      */
      */
     public function testSetForm()
     public function testSetForm()
@@ -135,6 +137,8 @@ class AdminObjectAclDataTest extends \PHPUnit_Framework_TestCase
     /**
     /**
      * @depends testSetForm
      * @depends testSetForm
      *
      *
+     * @group legacy
+     *
      * @deprecated
      * @deprecated
      */
      */
     public function testGetForm($adminObjectAclData)
     public function testGetForm($adminObjectAclData)

+ 11 - 0
Tests/tests/bootstrap.php

@@ -17,3 +17,14 @@ if (file_exists($file = __DIR__.'/autoload.php')) {
 } elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
 } elseif (file_exists($file = __DIR__.'/autoload.php.dist')) {
     require_once $file;
     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);
+}

+ 2 - 1
composer.json

@@ -41,7 +41,8 @@
     "require-dev": {
     "require-dev": {
         "jms/translation-bundle": "~1.1",
         "jms/translation-bundle": "~1.1",
         "symfony/yaml": "~2.3",
         "symfony/yaml": "~2.3",
-        "sonata-project/intl-bundle": "~2.1"
+        "sonata-project/intl-bundle": "~2.1",
+        "symfony/phpunit-bridge": "2.7.*@dev"
     },
     },
     "suggest": {
     "suggest": {
         "jms/translation-bundle": "Extract message keys from Admins",
         "jms/translation-bundle": "Extract message keys from Admins",