function it_issues_an_auth_code(AuthorizationServer $issuer, AuthCodeGrant $authCodeGrant) { $authCodeGrant->newAuthorizeRequest('user', '1', ['foo' => 'bar'])->willReturn('baz')->shouldBeCalled(); $issuer->getGrantType('authorization_code')->willReturn($authCodeGrant)->shouldBeCalled(); $this->issueAuthCode('user', '1', ['foo' => 'bar'])->shouldReturn('baz'); }