Skip to content

Commit 2044bea

Browse files
committed
Replace calls to setExpectedException by Pollyfill
1 parent 24a4fbc commit 2044bea

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
1516
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration;
1617
use Symfony\Bundle\FullStack;
1718
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
@@ -20,6 +21,8 @@
2021

2122
class ConfigurationTest extends TestCase
2223
{
24+
use ForwardCompatTestTrait;
25+
2326
public function testDefaultConfig()
2427
{
2528
$processor = new Processor();
@@ -245,12 +248,8 @@ public function provideValidAssetsPackageNameConfigurationTests()
245248
*/
246249
public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMessage)
247250
{
248-
if (method_exists($this, 'expectException')) {
249-
$this->expectException(InvalidConfigurationException::class);
250-
$this->expectExceptionMessage($expectedMessage);
251-
} else {
252-
$this->setExpectedException(InvalidConfigurationException::class, $expectedMessage);
253-
}
251+
$this->expectException(InvalidConfigurationException::class);
252+
$this->expectExceptionMessage($expectedMessage);
254253

255254
$processor = new Processor();
256255
$configuration = new Configuration(true);

0 commit comments

Comments
 (0)