ClientRepository implementations are now responsible for dealing with client secret

This commit is contained in:
Alex Bilbie
2016-03-22 16:29:04 +00:00
parent f688401f63
commit 878afeb9f9
5 changed files with 12 additions and 35 deletions

View File

@@ -111,10 +111,8 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
*/
public function testValidateClientMissingClientSecret()
{
$client = new ClientEntity();
$client->setSecret('bar');
$clientRepositoryMock = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
$clientRepositoryMock->method('getClientEntity')->willReturn($client);
$clientRepositoryMock->method('getClientEntity')->willReturn(null);
/** @var AbstractGrant $grantMock */
$grantMock = $this->getMockForAbstractClass(AbstractGrant::class);
@@ -138,10 +136,8 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
*/
public function testValidateClientInvalidClientSecret()
{
$client = new ClientEntity();
$client->setSecret('bar');
$clientRepositoryMock = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
$clientRepositoryMock->method('getClientEntity')->willReturn($client);
$clientRepositoryMock->method('getClientEntity')->willReturn(null);
/** @var AbstractGrant $grantMock */
$grantMock = $this->getMockForAbstractClass(AbstractGrant::class);