@@ -50,7 +50,7 @@ public function testEnvironment()
50
50
*/
51
51
public function testGetSession ()
52
52
{
53
- $ request = $ this ->getMockBuilder (' Symfony\Component\HttpFoundation\ Request' )->getMock ();
53
+ $ request = $ this ->getMockBuilder (Request::class )->getMock ();
54
54
$ request ->method ('hasSession ' )->willReturn (true );
55
55
$ request ->method ('getSession ' )->willReturn ($ session = new Session ());
56
56
@@ -75,18 +75,18 @@ public function testGetRequest()
75
75
76
76
public function testGetToken ()
77
77
{
78
- $ tokenStorage = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )->getMock ();
78
+ $ tokenStorage = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface::class )->getMock ();
79
79
$ this ->appVariable ->setTokenStorage ($ tokenStorage );
80
80
81
- $ token = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
81
+ $ token = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \TokenInterface::class )->getMock ();
82
82
$ tokenStorage ->method ('getToken ' )->willReturn ($ token );
83
83
84
84
$ this ->assertEquals ($ token , $ this ->appVariable ->getToken ());
85
85
}
86
86
87
87
public function testGetUser ()
88
88
{
89
- $ this ->setTokenStorage ($ user = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\UserInterface ' )->getMock ());
89
+ $ this ->setTokenStorage ($ user = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \User \UserInterface::class )->getMock ());
90
90
91
91
$ this ->assertEquals ($ user , $ this ->appVariable ->getUser ());
92
92
}
@@ -100,53 +100,53 @@ public function testGetUserWithUsernameAsTokenUser()
100
100
101
101
public function testGetTokenWithNoToken ()
102
102
{
103
- $ tokenStorage = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )->getMock ();
103
+ $ tokenStorage = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface::class )->getMock ();
104
104
$ this ->appVariable ->setTokenStorage ($ tokenStorage );
105
105
106
106
$ this ->assertNull ($ this ->appVariable ->getToken ());
107
107
}
108
108
109
109
public function testGetUserWithNoToken ()
110
110
{
111
- $ tokenStorage = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )->getMock ();
111
+ $ tokenStorage = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface::class )->getMock ();
112
112
$ this ->appVariable ->setTokenStorage ($ tokenStorage );
113
113
114
114
$ this ->assertNull ($ this ->appVariable ->getUser ());
115
115
}
116
116
117
117
public function testEnvironmentNotSet ()
118
118
{
119
- $ this ->expectException (' RuntimeException ' );
119
+ $ this ->expectException (\ RuntimeException::class );
120
120
$ this ->appVariable ->getEnvironment ();
121
121
}
122
122
123
123
public function testDebugNotSet ()
124
124
{
125
- $ this ->expectException (' RuntimeException ' );
125
+ $ this ->expectException (\ RuntimeException::class );
126
126
$ this ->appVariable ->getDebug ();
127
127
}
128
128
129
129
public function testGetTokenWithTokenStorageNotSet ()
130
130
{
131
- $ this ->expectException (' RuntimeException ' );
131
+ $ this ->expectException (\ RuntimeException::class );
132
132
$ this ->appVariable ->getToken ();
133
133
}
134
134
135
135
public function testGetUserWithTokenStorageNotSet ()
136
136
{
137
- $ this ->expectException (' RuntimeException ' );
137
+ $ this ->expectException (\ RuntimeException::class );
138
138
$ this ->appVariable ->getUser ();
139
139
}
140
140
141
141
public function testGetRequestWithRequestStackNotSet ()
142
142
{
143
- $ this ->expectException (' RuntimeException ' );
143
+ $ this ->expectException (\ RuntimeException::class );
144
144
$ this ->appVariable ->getRequest ();
145
145
}
146
146
147
147
public function testGetSessionWithRequestStackNotSet ()
148
148
{
149
- $ this ->expectException (' RuntimeException ' );
149
+ $ this ->expectException (\ RuntimeException::class );
150
150
$ this ->appVariable ->getSession ();
151
151
}
152
152
@@ -224,18 +224,18 @@ public function testGetFlashes()
224
224
225
225
protected function setRequestStack ($ request )
226
226
{
227
- $ requestStackMock = $ this ->getMockBuilder (' Symfony\Component\HttpFoundation\RequestStack ' )->getMock ();
227
+ $ requestStackMock = $ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \RequestStack::class )->getMock ();
228
228
$ requestStackMock ->method ('getCurrentRequest ' )->willReturn ($ request );
229
229
230
230
$ this ->appVariable ->setRequestStack ($ requestStackMock );
231
231
}
232
232
233
233
protected function setTokenStorage ($ user )
234
234
{
235
- $ tokenStorage = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )->getMock ();
235
+ $ tokenStorage = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface::class )->getMock ();
236
236
$ this ->appVariable ->setTokenStorage ($ tokenStorage );
237
237
238
- $ token = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
238
+ $ token = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \TokenInterface::class )->getMock ();
239
239
$ tokenStorage ->method ('getToken ' )->willReturn ($ token );
240
240
241
241
$ token ->method ('getUser ' )->willReturn ($ user );
@@ -251,11 +251,11 @@ private function setFlashMessages($sessionHasStarted = true)
251
251
$ flashBag = new FlashBag ();
252
252
$ flashBag ->initialize ($ flashMessages );
253
253
254
- $ session = $ this ->getMockBuilder (' Symfony\Component\HttpFoundation\ Session\Session ' )->disableOriginalConstructor ()->getMock ();
254
+ $ session = $ this ->getMockBuilder (Session::class )->disableOriginalConstructor ()->getMock ();
255
255
$ session ->method ('isStarted ' )->willReturn ($ sessionHasStarted );
256
256
$ session ->method ('getFlashBag ' )->willReturn ($ flashBag );
257
257
258
- $ request = $ this ->getMockBuilder (' Symfony\Component\HttpFoundation\ Request' )->getMock ();
258
+ $ request = $ this ->getMockBuilder (Request::class )->getMock ();
259
259
$ request ->method ('hasSession ' )->willReturn (true );
260
260
$ request ->method ('getSession ' )->willReturn ($ session );
261
261
$ this ->setRequestStack ($ request );
0 commit comments