Skip to content

Commit

Permalink
Installed PhpUnit Bridge to make deprecation testing easier
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Feb 26, 2015
1 parent 8b639c1 commit 982a06f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Tests/Datagrid/ListMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
4 changes: 4 additions & 0 deletions Tests/Util/AdminObjectAclDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public function testGetMasks()
}

/**
* @group legacy
*
* @deprecated
*/
public function testSetForm()
Expand All @@ -135,6 +137,8 @@ public function testSetForm()
/**
* @depends testSetForm
*
* @group legacy
*
* @deprecated
*/
public function testGetForm($adminObjectAclData)
Expand Down
11 changes: 11 additions & 0 deletions Tests/tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 982a06f

Please sign in to comment.