Fixed expectedException annotations

This commit is contained in:
Roland Franssen 2016-09-22 17:52:33 +00:00 committed by Fabien Potencier
parent fc0fe87c6d
commit b074a7156a
2 changed files with 4 additions and 6 deletions

View File

@ -93,7 +93,7 @@ class ControllerNameParserTest extends TestCase
try { try {
$parser->parse($name); $parser->parse($name);
$this->fail('->parse() throws a \InvalidArgumentException if the string is in the valid format, but not matching class can be found'); $this->fail('->parse() throws a \InvalidArgumentException if the class is found but does not exist');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the class is found but does not exist'); $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the class is found but does not exist');
} }
@ -108,7 +108,6 @@ class ControllerNameParserTest extends TestCase
} }
/** /**
* @expectedException
* @dataProvider getInvalidBundleNameTests * @dataProvider getInvalidBundleNameTests
*/ */
public function testInvalidBundleName($bundleName, $suggestedBundleName) public function testInvalidBundleName($bundleName, $suggestedBundleName)
@ -117,6 +116,7 @@ class ControllerNameParserTest extends TestCase
try { try {
$parser->parse($bundleName); $parser->parse($bundleName);
$this->fail('->parse() throws a \InvalidArgumentException if the bundle does not exist');
} catch (\Exception $e) { } catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the bundle does not exist'); $this->assertInstanceOf('\InvalidArgumentException', $e, '->parse() throws a \InvalidArgumentException if the bundle does not exist');

View File

@ -14,8 +14,6 @@ namespace Symfony\Component\Asset\Tests;
use Symfony\Component\Asset\UrlPackage; use Symfony\Component\Asset\UrlPackage;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy; use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy; use Symfony\Component\Asset\VersionStrategy\EmptyVersionStrategy;
use Symfony\Component\Asset\Exception\InvalidArgumentException;
use Symfony\Component\Asset\Exception\LogicException;
class UrlPackageTest extends \PHPUnit_Framework_TestCase class UrlPackageTest extends \PHPUnit_Framework_TestCase
{ {
@ -79,7 +77,7 @@ class UrlPackageTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException LogicException * @expectedException \Symfony\Component\Asset\Exception\LogicException
*/ */
public function testNoBaseUrls() public function testNoBaseUrls()
{ {
@ -87,7 +85,7 @@ class UrlPackageTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException InvalidArgumentException * @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException
*/ */
public function testWrongBaseUrl() public function testWrongBaseUrl()
{ {