|
14 | 14 | use PHPUnit\Framework\TestCase;
|
15 | 15 | use Symfony\Component\DependencyInjection\Container;
|
16 | 16 | use Symfony\Component\DependencyInjection\ContainerInterface;
|
| 17 | +use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; |
17 | 18 | use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
|
18 | 19 | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
19 | 20 | use Symfony\Contracts\Service\ResetInterface;
|
@@ -116,7 +117,7 @@ public function testGetSetParameter()
|
116 | 117 | $sc->getParameter('baba');
|
117 | 118 | $this->fail('->getParameter() thrown an \InvalidArgumentException if the key does not exist');
|
118 | 119 | } catch (\Exception $e) {
|
119 |
| - $this->assertInstanceOf('\InvalidArgumentException', $e, '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); |
| 120 | + $this->assertInstanceOf(\InvalidArgumentException::class, $e, '->getParameter() thrown an \InvalidArgumentException if the key does not exist'); |
120 | 121 | $this->assertEquals('You have requested a non-existent parameter "baba".', $e->getMessage(), '->getParameter() thrown an \InvalidArgumentException if the key does not exist');
|
121 | 122 | }
|
122 | 123 | }
|
@@ -252,7 +253,7 @@ public function testGetCircularReference()
|
252 | 253 | $sc->get('circular');
|
253 | 254 | $this->fail('->get() throws a ServiceCircularReferenceException if it contains circular reference');
|
254 | 255 | } catch (\Exception $e) {
|
255 |
| - $this->assertInstanceOf('\Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException', $e, '->get() throws a ServiceCircularReferenceException if it contains circular reference'); |
| 256 | + $this->assertInstanceOf(ServiceCircularReferenceException::class, $e, '->get() throws a ServiceCircularReferenceException if it contains circular reference'); |
256 | 257 | $this->assertStringStartsWith('Circular reference detected for service "circular"', $e->getMessage(), '->get() throws a \LogicException if it contains circular reference');
|
257 | 258 | }
|
258 | 259 | }
|
|
0 commit comments