Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Exception Message from its key, Explicit Travis build env, and .idea to gitignore #687

Merged
merged 3 commits into from
Oct 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ build
vendor
composer.lock
composer.phar
.idea
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: php

dist: trusty

matrix:
fast_finish: true
include:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
{
$event = new AuthenticationFailureEvent(
$exception,
new JWTAuthenticationFailureResponse($exception->getMessage())
new JWTAuthenticationFailureResponse($exception->getMessageKey())
);

if ($this->dispatcher instanceof ContractsEventDispatcherInterface) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/GetTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testGetTokenFromInvalidCredentials()
$this->assertArrayHasKey('message', $body, 'The response should have a "message" key containing the failure reason.');
$this->assertArrayHasKey('code', $body, 'The response should have a "code" key containing the response status code.');

$this->assertSame('Bad credentials.', $body['message']);
$this->assertSame('Invalid credentials.', $body['message']);
$this->assertSame(401, $body['code']);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testOnAuthenticationFailure()
$this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response);
$this->assertEquals(401, $response->getStatusCode());
$this->assertEquals(401, $content['code']);
$this->assertEquals($authenticationException->getMessage(), $content['message']);
$this->assertEquals($authenticationException->getMessageKey(), $content['message']);
}

/**
Expand All @@ -47,7 +47,7 @@ protected function getRequest()
}

/**
* @return \PHPUnit_Framework_MockObject_MockObject
* @return AuthenticationException
*/
protected function getAuthenticationException()
{
Expand Down