@@ -26,7 +26,7 @@ class RouterTest extends TestCase
26
26
27
27
protected function setUp (): void
28
28
{
29
- $ this ->loader = $ this ->getMockBuilder (' Symfony\Component\Config\Loader\LoaderInterface ' )->getMock ();
29
+ $ this ->loader = $ this ->getMockBuilder (\ Symfony \Component \Config \Loader \LoaderInterface::class )->getMock ();
30
30
$ this ->router = new Router ($ this ->loader , 'routing.yml ' );
31
31
32
32
$ this ->cacheDir = sys_get_temp_dir ().\DIRECTORY_SEPARATOR .uniqid ('router_ ' , true );
@@ -59,7 +59,7 @@ public function testSetOptionsWithSupportedOptions()
59
59
60
60
public function testSetOptionsWithUnsupportedOptions ()
61
61
{
62
- $ this ->expectException (' InvalidArgumentException ' );
62
+ $ this ->expectException (\ InvalidArgumentException::class );
63
63
$ this ->expectExceptionMessage ('The Router does not support the following options: "option_foo", "option_bar" ' );
64
64
$ this ->router ->setOptions ([
65
65
'cache_dir ' => './cache ' ,
@@ -78,14 +78,14 @@ public function testSetOptionWithSupportedOption()
78
78
79
79
public function testSetOptionWithUnsupportedOption ()
80
80
{
81
- $ this ->expectException (' InvalidArgumentException ' );
81
+ $ this ->expectException (\ InvalidArgumentException::class );
82
82
$ this ->expectExceptionMessage ('The Router does not support the "option_foo" option ' );
83
83
$ this ->router ->setOption ('option_foo ' , true );
84
84
}
85
85
86
86
public function testGetOptionWithUnsupportedOption ()
87
87
{
88
- $ this ->expectException (' InvalidArgumentException ' );
88
+ $ this ->expectException (\ InvalidArgumentException::class );
89
89
$ this ->expectExceptionMessage ('The Router does not support the "option_foo" option ' );
90
90
$ this ->router ->getOption ('option_foo ' , true );
91
91
}
@@ -111,7 +111,7 @@ public function testMatcherIsCreatedIfCacheIsNotConfigured()
111
111
->method ('load ' )->with ('routing.yml ' , null )
112
112
->willReturn (new RouteCollection ());
113
113
114
- $ this ->assertInstanceOf (' Symfony \\ Component \\ Routing \\ Matcher \\ UrlMatcher ' , $ this ->router ->getMatcher ());
114
+ $ this ->assertInstanceOf (\ Symfony \Component \Routing \Matcher \UrlMatcher::class , $ this ->router ->getMatcher ());
115
115
}
116
116
117
117
public function testGeneratorIsCreatedIfCacheIsNotConfigured ()
@@ -122,12 +122,12 @@ public function testGeneratorIsCreatedIfCacheIsNotConfigured()
122
122
->method ('load ' )->with ('routing.yml ' , null )
123
123
->willReturn (new RouteCollection ());
124
124
125
- $ this ->assertInstanceOf (' Symfony \\ Component \\ Routing \\ Generator \\ UrlGenerator ' , $ this ->router ->getGenerator ());
125
+ $ this ->assertInstanceOf (\ Symfony \Component \Routing \Generator \UrlGenerator::class , $ this ->router ->getGenerator ());
126
126
}
127
127
128
128
public function testMatchRequestWithUrlMatcherInterface ()
129
129
{
130
- $ matcher = $ this ->getMockBuilder (' Symfony\Component\Routing\Matcher\UrlMatcherInterface ' )->getMock ();
130
+ $ matcher = $ this ->getMockBuilder (\ Symfony \Component \Routing \Matcher \UrlMatcherInterface::class )->getMock ();
131
131
$ matcher ->expects ($ this ->once ())->method ('match ' );
132
132
133
133
$ p = new \ReflectionProperty ($ this ->router , 'matcher ' );
@@ -139,7 +139,7 @@ public function testMatchRequestWithUrlMatcherInterface()
139
139
140
140
public function testMatchRequestWithRequestMatcherInterface ()
141
141
{
142
- $ matcher = $ this ->getMockBuilder (' Symfony\Component\Routing\Matcher\RequestMatcherInterface ' )->getMock ();
142
+ $ matcher = $ this ->getMockBuilder (\ Symfony \Component \Routing \Matcher \RequestMatcherInterface::class )->getMock ();
143
143
$ matcher ->expects ($ this ->once ())->method ('matchRequest ' );
144
144
145
145
$ p = new \ReflectionProperty ($ this ->router , 'matcher ' );
@@ -161,7 +161,7 @@ public function testDefaultLocaleIsPassedToGeneratorClass()
161
161
162
162
$ generator = $ router ->getGenerator ();
163
163
164
- $ this ->assertInstanceOf (' Symfony\Component\Routing\Generator\UrlGeneratorInterface ' , $ generator );
164
+ $ this ->assertInstanceOf (\ Symfony \Component \Routing \Generator \UrlGeneratorInterface::class , $ generator );
165
165
166
166
$ p = new \ReflectionProperty ($ generator , 'defaultLocale ' );
167
167
$ p ->setAccessible (true );
@@ -181,7 +181,7 @@ public function testDefaultLocaleIsPassedToCompiledGeneratorCacheClass()
181
181
182
182
$ generator = $ router ->getGenerator ();
183
183
184
- $ this ->assertInstanceOf (' Symfony\Component\Routing\Generator\UrlGeneratorInterface ' , $ generator );
184
+ $ this ->assertInstanceOf (\ Symfony \Component \Routing \Generator \UrlGeneratorInterface::class , $ generator );
185
185
186
186
$ p = new \ReflectionProperty ($ generator , 'defaultLocale ' );
187
187
$ p ->setAccessible (true );
0 commit comments