Skip to content

Commit 3acb008

Browse files
committed
fix deprecations
1 parent 952a5fb commit 3acb008

File tree

3 files changed

+28
-30
lines changed

3 files changed

+28
-30
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
"firebase/php-jwt": "^5.0"
3636
},
3737
"require-dev": {
38+
"brianium/paratest": "^6.3",
3839
"cakephp/cakephp-codesniffer": "^4.0",
3940
"league/flysystem-vfs": "^1.0",
40-
"phpunit/phpunit": "^8.0",
41+
"phpunit/phpunit": "^9.4",
4142
"vlucas/phpdotenv": "^3.3"
4243
},
4344
"autoload": {

psalm.xml

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
<MoreSpecificReturnType errorLevel="info" />
4444
<LessSpecificReturnStatement errorLevel="info" />
45-
<TypeCoercion errorLevel="info" />
4645

4746
<PossiblyInvalidArrayAccess errorLevel="info" />
4847
<PossiblyInvalidArrayOffset errorLevel="info" />

tests/TestCase/Auth/Authenticate/SocialAuthenticateTest.php

+26-28
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,19 @@ public function testHeaderHappy()
136136
->setMethods(['getHeader'])
137137
->getMock();
138138

139-
$request->expects($this->at(0))
140-
->method('getHeader')
141-
->with('provider')
142-
->will($this->returnValue(['Facebook']));
143-
144-
$request->expects($this->at(1))
145-
->method('getHeader')
146-
->with('token')
147-
->will($this->returnValue(['token-1234']));
148-
149-
$request->expects($this->at(2))
150-
->method('getHeader')
151-
->with('token_secret')
152-
->will($this->returnValue(['token-secret']));
139+
$request->expects($this->exactly(3))
140+
->method('getHeader')
141+
->withConsecutive(
142+
['provider'],
143+
['token'],
144+
['token_secret'],
145+
)
146+
->willReturnOnConsecutiveCalls(
147+
$this->returnValue(['Facebook']),
148+
$this->returnValue(['token-1234']),
149+
$this->returnValue(['token-secret']),
150+
);
151+
153152
$this->social->setConfig('type', 'header');
154153
$result = $this->social->authenticate($request, new Response());
155154
$this->assertEquals('user-1', $result['username']);
@@ -165,20 +164,19 @@ public function testAuthenticateHeaderFail()
165164
$request = $this->getMockBuilder(\Cake\Http\ServerRequest::class)
166165
->setMethods(['getHeader'])
167166
->getMock();
168-
$request->expects($this->at(0))
169-
->method('getHeader')
170-
->with('provider')
171-
->will($this->returnValue(['wrong']));
172-
173-
$request->expects($this->at(1))
174-
->method('getHeader')
175-
->with('token')
176-
->will($this->returnValue(['wrong']));
177-
178-
$request->expects($this->at(2))
179-
->method('getHeader')
180-
->with('token_secret')
181-
->will($this->returnValue(['wrong']));
167+
$request->expects($this->exactly(3))
168+
->method('getHeader')
169+
->withConsecutive(
170+
[$this->equalTo('provider')],
171+
[$this->equalTo('token')],
172+
[$this->equalTo('token_secret')],
173+
)
174+
->willReturnOnConsecutiveCalls(
175+
$this->returnValue(['wrong']),
176+
$this->returnValue(['wrong']),
177+
$this->returnValue(['wrong']),
178+
);
179+
182180
$this->social->setConfig('type', 'header');
183181
$result = $this->social->authenticate($request, new Response());
184182
$this->assertFalse($result);

0 commit comments

Comments
 (0)