Skip to content

Commit 0a877e4

Browse files
authored
Make tests compatible with PHPUnit 8 (#664)
1 parent e87859e commit 0a877e4

31 files changed

+237
-237
lines changed

Tests/Command/CleanCommandTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ class CleanCommandTest extends \PHPUnit\Framework\TestCase
2727
private $command;
2828

2929
/**
30-
* @var \PHPUnit_Framework_MockObject_MockObject|TokenManagerInterface
30+
* @var \PHPUnit\Framework\MockObject\MockObject|TokenManagerInterface
3131
*/
3232
private $accessTokenManager;
3333

3434
/**
35-
* @var \PHPUnit_Framework_MockObject_MockObject|TokenManagerInterface
35+
* @var \PHPUnit\Framework\MockObject\MockObject|TokenManagerInterface
3636
*/
3737
private $refreshTokenManager;
3838

3939
/**
40-
* @var \PHPUnit_Framework_MockObject_MockObject|AuthCodeManagerInterface
40+
* @var \PHPUnit\Framework\MockObject\MockObject|AuthCodeManagerInterface
4141
*/
4242
private $authCodeManager;
4343

@@ -64,7 +64,7 @@ protected function setUp(): void
6464
/**
6565
* Delete expired tokens for provided classes.
6666
*/
67-
public function testItShouldRemoveExpiredToken()
67+
public function testItShouldRemoveExpiredToken(): void
6868
{
6969
$expiredAccessTokens = 5;
7070
$this->accessTokenManager
@@ -100,7 +100,7 @@ public function testItShouldRemoveExpiredToken()
100100
/**
101101
* Skip classes for deleting expired tokens that do not implement AuthCodeManagerInterface or TokenManagerInterface.
102102
*/
103-
public function testItShouldNotRemoveExpiredTokensForOtherClasses()
103+
public function testItShouldNotRemoveExpiredTokensForOtherClasses(): void
104104
{
105105
$this->markTestIncomplete('Needs a better way of testing this');
106106

Tests/Command/CreateClientCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CreateClientCommandTest extends TestCase
2727
private $command;
2828

2929
/**
30-
* @var \PHPUnit_Framework_MockObject_MockObject|ClientManagerInterface
30+
* @var \PHPUnit\Framework\MockObject\MockObject|ClientManagerInterface
3131
*/
3232
private $clientManager;
3333

@@ -53,7 +53,7 @@ protected function setUp(): void
5353
*
5454
* @param string $client a fully qualified class name
5555
*/
56-
public function testItShouldCreateClient($client)
56+
public function testItShouldCreateClient($client): void
5757
{
5858
$this
5959
->clientManager

Tests/Controller/AuthorizeControllerTest.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,52 +38,52 @@
3838
class AuthorizeControllerTest extends \PHPUnit\Framework\TestCase
3939
{
4040
/**
41-
* @var \PHPUnit_Framework_MockObject_MockObject|RequestStack
41+
* @var \PHPUnit\Framework\MockObject\MockObject|RequestStack
4242
*/
4343
protected $requestStack;
4444

4545
/**
46-
* @var \PHPUnit_Framework_MockObject_MockObject|SessionInterface
46+
* @var \PHPUnit\Framework\MockObject\MockObject|SessionInterface
4747
*/
4848
protected $session;
4949

5050
/**
51-
* @var \PHPUnit_Framework_MockObject_MockObject|Form
51+
* @var \PHPUnit\Framework\MockObject\MockObject|Form
5252
*/
5353
protected $form;
5454

5555
/**
56-
* @var \PHPUnit_Framework_MockObject_MockObject|AuthorizeFormHandler
56+
* @var \PHPUnit\Framework\MockObject\MockObject|AuthorizeFormHandler
5757
*/
5858
protected $authorizeFormHandler;
5959

6060
/**
61-
* @var \PHPUnit_Framework_MockObject_MockObject|OAuth2
61+
* @var \PHPUnit\Framework\MockObject\MockObject|OAuth2
6262
*/
6363
protected $oAuth2Server;
6464

6565
/**
66-
* @var \PHPUnit_Framework_MockObject_MockObject|TokenStorageInterface
66+
* @var \PHPUnit\Framework\MockObject\MockObject|TokenStorageInterface
6767
*/
6868
protected $tokenStorage;
6969

7070
/**
71-
* @var \PHPUnit_Framework_MockObject_MockObject|TwigEnvironment
71+
* @var \PHPUnit\Framework\MockObject\MockObject|TwigEnvironment
7272
*/
7373
protected $twig;
7474

7575
/**
76-
* @var \PHPUnit_Framework_MockObject_MockObject|UrlGeneratorInterface
76+
* @var \PHPUnit\Framework\MockObject\MockObject|UrlGeneratorInterface
7777
*/
7878
protected $router;
7979

8080
/**
81-
* @var \PHPUnit_Framework_MockObject_MockObject|ClientManagerInterface
81+
* @var \PHPUnit\Framework\MockObject\MockObject|ClientManagerInterface
8282
*/
8383
protected $clientManager;
8484

8585
/**
86-
* @var \PHPUnit_Framework_MockObject_MockObject|EventDispatcherInterface
86+
* @var \PHPUnit\Framework\MockObject\MockObject|EventDispatcherInterface
8787
*/
8888
protected $eventDispatcher;
8989

@@ -93,46 +93,46 @@ class AuthorizeControllerTest extends \PHPUnit\Framework\TestCase
9393
protected $instance;
9494

9595
/**
96-
* @var \PHPUnit_Framework_MockObject_MockObject|Request
96+
* @var \PHPUnit\Framework\MockObject\MockObject|Request
9797
*/
9898
protected $request;
9999

100100
/**
101-
* @var \PHPUnit_Framework_MockObject_MockObject|ParameterBag
101+
* @var \PHPUnit\Framework\MockObject\MockObject|ParameterBag
102102
*/
103103
protected $requestQuery;
104104

105105
/**
106-
* @var \PHPUnit_Framework_MockObject_MockObject|ParameterBag
106+
* @var \PHPUnit\Framework\MockObject\MockObject|ParameterBag
107107
*/
108108
protected $requestRequest;
109109

110110
/**
111-
* @var \PHPUnit_Framework_MockObject_MockObject|UserInterface
111+
* @var \PHPUnit\Framework\MockObject\MockObject|UserInterface
112112
*/
113113
protected $user;
114114

115115
/**
116-
* @var \PHPUnit_Framework_MockObject_MockObject|ClientInterface
116+
* @var \PHPUnit\Framework\MockObject\MockObject|ClientInterface
117117
*/
118118
protected $client;
119119

120120
/**
121-
* @var \PHPUnit_Framework_MockObject_MockObject|PreAuthorizationEvent
121+
* @var \PHPUnit\Framework\MockObject\MockObject|PreAuthorizationEvent
122122
*/
123123
protected $preAuthorizationEvent;
124124

125125
/**
126-
* @var \PHPUnit_Framework_MockObject_MockObject|PostAuthorizationEvent
126+
* @var \PHPUnit\Framework\MockObject\MockObject|PostAuthorizationEvent
127127
*/
128128
protected $postAuthorizationEvent;
129129

130130
/**
131-
* @var \PHPUnit_Framework_MockObject_MockObject|FormView
131+
* @var \PHPUnit\Framework\MockObject\MockObject|FormView
132132
*/
133133
protected $formView;
134134

135-
public function setUp()
135+
public function setUp(): void
136136
{
137137
$this->requestStack = $this->getMockBuilder(RequestStack::class)
138138
->disableOriginalConstructor()
@@ -188,7 +188,7 @@ public function setUp()
188188
$this->session
189189
);
190190

191-
/** @var \PHPUnit_Framework_MockObject_MockObject&Request $request */
191+
/** @var \PHPUnit\Framework\MockObject\MockObject&Request $request */
192192
$request = $this->getMockBuilder(Request::class)
193193
->disableOriginalConstructor()
194194
->getMock()
@@ -228,7 +228,7 @@ public function setUp()
228228
parent::setUp();
229229
}
230230

231-
public function testAuthorizeActionWillThrowAccessDeniedException()
231+
public function testAuthorizeActionWillThrowAccessDeniedException(): void
232232
{
233233
$token = $this->getMockBuilder(TokenInterface::class)
234234
->disableOriginalConstructor()
@@ -253,7 +253,7 @@ public function testAuthorizeActionWillThrowAccessDeniedException()
253253
$this->instance->authorizeAction($this->request);
254254
}
255255

256-
public function testAuthorizeActionWillRenderTemplate()
256+
public function testAuthorizeActionWillRenderTemplate(): void
257257
{
258258
$token = $this->getMockBuilder(TokenInterface::class)
259259
->disableOriginalConstructor()
@@ -325,7 +325,7 @@ public function testAuthorizeActionWillRenderTemplate()
325325
$this->assertSame($responseBody, $this->instance->authorizeAction($this->request)->getContent());
326326
}
327327

328-
public function testAuthorizeActionWillFinishClientAuthorization()
328+
public function testAuthorizeActionWillFinishClientAuthorization(): void
329329
{
330330
$token = $this->getMockBuilder(TokenInterface::class)
331331
->disableOriginalConstructor()
@@ -394,7 +394,7 @@ public function testAuthorizeActionWillFinishClientAuthorization()
394394
$this->assertSame($response, $this->instance->authorizeAction($this->request));
395395
}
396396

397-
public function testAuthorizeActionWillEnsureLogout()
397+
public function testAuthorizeActionWillEnsureLogout(): void
398398
{
399399
$token = $this->getMockBuilder(TokenInterface::class)
400400
->disableOriginalConstructor()
@@ -480,7 +480,7 @@ public function testAuthorizeActionWillEnsureLogout()
480480
$this->assertSame($responseBody, $this->instance->authorizeAction($this->request)->getContent());
481481
}
482482

483-
public function testAuthorizeActionWillProcessAuthorizationForm()
483+
public function testAuthorizeActionWillProcessAuthorizationForm(): void
484484
{
485485
$token = $this->getMockBuilder(TokenInterface::class)
486486
->disableOriginalConstructor()

Tests/DependencyInjection/Compiler/GrantExtensionsCompilerPassTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class GrantExtensionsCompilerPassTest extends \PHPUnit\Framework\TestCase
3333
*/
3434
protected $instance;
3535

36-
public function setUp()
36+
public function setUp(): void
3737
{
3838
$this->instance = new GrantExtensionsCompilerPass();
3939

4040
parent::setUp();
4141
}
4242

43-
public function testProcessWillNotDoAnythingIfTheStorageDoesNotImplementOurInterface()
43+
public function testProcessWillNotDoAnythingIfTheStorageDoesNotImplementOurInterface(): void
4444
{
4545
$container = $this->getMockBuilder(ContainerBuilder::class)
4646
->disableOriginalConstructor()
@@ -93,7 +93,7 @@ public function testProcessWillNotDoAnythingIfTheStorageDoesNotImplementOurInter
9393
$this->assertNull($this->instance->process($container));
9494
}
9595

96-
public function testProcessWillFailIfUriIsEmpty()
96+
public function testProcessWillFailIfUriIsEmpty(): void
9797
{
9898
$container = $this->getMockBuilder(ContainerBuilder::class)
9999
->disableOriginalConstructor()
@@ -197,7 +197,7 @@ public function testProcessWillFailIfUriIsEmpty()
197197
$this->assertNull($this->instance->process($container));
198198
}
199199

200-
public function testProcess()
200+
public function testProcess(): void
201201
{
202202
$container = $this->getMockBuilder(ContainerBuilder::class)
203203
->disableOriginalConstructor()

Tests/DependencyInjection/Compiler/RequestStackCompilerPassTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ class RequestStackCompilerPassTest extends \PHPUnit\Framework\TestCase
3131
protected $instance;
3232

3333
/**
34-
* @var \PHPUnit_Framework_MockObject_MockObject|ContainerBuilder
34+
* @var \PHPUnit\Framework\MockObject\MockObject|ContainerBuilder
3535
*/
3636
protected $container;
3737

38-
public function setUp()
38+
public function setUp(): void
3939
{
4040
$this->container = $this->getMockBuilder(ContainerBuilder::class)
4141
->disableOriginalConstructor()
@@ -51,7 +51,7 @@ public function setUp()
5151
parent::setUp();
5252
}
5353

54-
public function testProcessWithoutRequestStackDoesNothing()
54+
public function testProcessWithoutRequestStackDoesNothing(): void
5555
{
5656
$this->container
5757
->expects($this->once())
@@ -63,7 +63,7 @@ public function testProcessWithoutRequestStackDoesNothing()
6363
$this->assertNull($this->instance->process($this->container));
6464
}
6565

66-
public function testProcess()
66+
public function testProcess(): void
6767
{
6868
$this->container
6969
->expects($this->once())

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
class ConfigurationTest extends \PHPUnit\Framework\TestCase
2222
{
23-
public function testShouldImplementConfigurationInterface()
23+
public function testShouldImplementConfigurationInterface(): void
2424
{
2525
$rc = new \ReflectionClass(Configuration::class);
2626

2727
$this->assertTrue($rc->implementsInterface(ConfigurationInterface::class));
2828
}
2929

30-
public function testCouldBeConstructedWithoutAnyArguments()
30+
public function testCouldBeConstructedWithoutAnyArguments(): void
3131
{
3232
try {
3333
new Configuration();
@@ -39,7 +39,7 @@ public function testCouldBeConstructedWithoutAnyArguments()
3939
}
4040
}
4141

42-
public function testShouldNotMandatoryServiceIfNotCustomDriverIsUsed()
42+
public function testShouldNotMandatoryServiceIfNotCustomDriverIsUsed(): void
4343
{
4444
$configuration = new Configuration();
4545
$processor = new Processor();
@@ -69,7 +69,7 @@ public function testShouldNotMandatoryServiceIfNotCustomDriverIsUsed()
6969
], $config);
7070
}
7171

72-
public function testShouldMakeClientManagerServiceMandatoryIfCustomDriverIsUsed()
72+
public function testShouldMakeClientManagerServiceMandatoryIfCustomDriverIsUsed(): void
7373
{
7474
$configuration = new Configuration();
7575
$processor = new Processor();
@@ -86,7 +86,7 @@ public function testShouldMakeClientManagerServiceMandatoryIfCustomDriverIsUsed(
8686
]]);
8787
}
8888

89-
public function testShouldMakeAccessTokenManagerServiceMandatoryIfCustomDriverIsUsed()
89+
public function testShouldMakeAccessTokenManagerServiceMandatoryIfCustomDriverIsUsed(): void
9090
{
9191
$configuration = new Configuration();
9292
$processor = new Processor();
@@ -106,7 +106,7 @@ public function testShouldMakeAccessTokenManagerServiceMandatoryIfCustomDriverIs
106106
]]);
107107
}
108108

109-
public function testShouldMakeRefreshTokenManagerServiceMandatoryIfCustomDriverIsUsed()
109+
public function testShouldMakeRefreshTokenManagerServiceMandatoryIfCustomDriverIsUsed(): void
110110
{
111111
$configuration = new Configuration();
112112
$processor = new Processor();
@@ -127,7 +127,7 @@ public function testShouldMakeRefreshTokenManagerServiceMandatoryIfCustomDriverI
127127
]]);
128128
}
129129

130-
public function testShouldMakeAuthCodeManagerServiceMandatoryIfCustomDriverIsUsed()
130+
public function testShouldMakeAuthCodeManagerServiceMandatoryIfCustomDriverIsUsed(): void
131131
{
132132
$configuration = new Configuration();
133133
$processor = new Processor();
@@ -149,7 +149,7 @@ public function testShouldMakeAuthCodeManagerServiceMandatoryIfCustomDriverIsUse
149149
]]);
150150
}
151151

152-
public function testShouldLoadCustomDriverConfig()
152+
public function testShouldLoadCustomDriverConfig(): void
153153
{
154154
$configuration = new Configuration();
155155
$processor = new Processor();

0 commit comments

Comments
 (0)