|
13 | 13 |
|
14 | 14 | use Doctrine\DBAL\Connection;
|
15 | 15 | use PHPUnit\Framework\TestCase;
|
| 16 | +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; |
16 | 17 | use Symfony\Bundle\FrameworkBundle\DependencyInjection\Configuration;
|
17 | 18 | use Symfony\Bundle\FullStack;
|
18 | 19 | use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
|
24 | 25 |
|
25 | 26 | class ConfigurationTest extends TestCase
|
26 | 27 | {
|
| 28 | + use ForwardCompatTestTrait; |
| 29 | + |
27 | 30 | public function testDefaultConfig()
|
28 | 31 | {
|
29 | 32 | $processor = new Processor();
|
@@ -140,12 +143,8 @@ public function provideValidAssetsPackageNameConfigurationTests()
|
140 | 143 | */
|
141 | 144 | public function testInvalidAssetsConfiguration(array $assetConfig, $expectedMessage)
|
142 | 145 | {
|
143 |
| - if (method_exists($this, 'expectException')) { |
144 |
| - $this->expectException(InvalidConfigurationException::class); |
145 |
| - $this->expectExceptionMessage($expectedMessage); |
146 |
| - } else { |
147 |
| - $this->setExpectedException(InvalidConfigurationException::class, $expectedMessage); |
148 |
| - } |
| 146 | + $this->expectException(InvalidConfigurationException::class); |
| 147 | + $this->expectExceptionMessage($expectedMessage); |
149 | 148 |
|
150 | 149 | $processor = new Processor();
|
151 | 150 | $configuration = new Configuration(true);
|
@@ -194,12 +193,8 @@ public function provideInvalidAssetConfigurationTests()
|
194 | 193 | public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefaultBus()
|
195 | 194 | {
|
196 | 195 | $expectedMessage = 'You must specify the "default_bus" if you define more than one bus.';
|
197 |
| - if (method_exists($this, 'expectException')) { |
198 |
| - $this->expectException(InvalidConfigurationException::class); |
199 |
| - $this->expectExceptionMessage($expectedMessage); |
200 |
| - } else { |
201 |
| - $this->setExpectedException(InvalidConfigurationException::class, $expectedMessage); |
202 |
| - } |
| 196 | + $this->expectException(InvalidConfigurationException::class); |
| 197 | + $this->expectExceptionMessage($expectedMessage); |
203 | 198 | $processor = new Processor();
|
204 | 199 | $configuration = new Configuration(true);
|
205 | 200 |
|
|
0 commit comments