-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scrutinizer Fixes Fix segmentation fault (infinite loop) BTW fix deprecation warning if funct test config Fixed setData logic in success+failure responses
- Loading branch information
Showing
6 changed files
with
37 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,18 +13,14 @@ final class JWTAuthenticationSuccessResponseTest extends \PHPUnit_Framework_Test | |
{ | ||
public function testResponse() | ||
{ | ||
$extraData = [ | ||
$data = [ | ||
'username' => 'foobar', | ||
'email' => '[email protected]' | ||
]; | ||
$expected = ['token' => 'jwt'] + $extraData; | ||
$expected = ['token' => 'jwt'] + $data; | ||
$response = new JWTAuthenticationSuccessResponse($expected['token'], $data); | ||
|
||
$response = new JWTAuthenticationSuccessResponse($expected['token'], $extraData); | ||
|
||
$this->assertSame($expected['token'], $response->getToken()); | ||
$this->assertSame(200, $response->getStatusCode()); | ||
$this->assertSame($extraData, $response->getExtraData()); | ||
|
||
$this->assertSame(json_encode($expected), $response->getContent()); | ||
|
||
return $response; | ||
|
@@ -40,9 +36,7 @@ public function testReplaceData(JWTAuthenticationSuccessResponse $response) | |
|
||
// Test that the previous method call has no effect on the original body | ||
$this->assertNotEquals(json_encode($replacementData), $response->getContent()); | ||
$this->assertSame( | ||
json_encode(['token' => $response->getToken()] + $response->getExtraData()), | ||
$response->getContent() | ||
); | ||
$this->assertAttributeSame($replacementData['foo'], 'foo', json_decode($response->getContent())); | ||
$this->assertAttributeNotEmpty('token', json_decode($response->getContent())); | ||
} | ||
} |