コード例 #1
0
 function it_throws_exception_if_requested_scopes_contains_scope_that_is_not_in_available_scopesusing_intersection(IScope $scope1, IScope $scope2, IScope $scope3, IScope $scope4)
 {
     $scope1->getId()->willReturn('scope1');
     $scope2->getId()->willReturn('scope2');
     $scope3->getId()->willReturn('scope3');
     $scope4->getId()->willReturn('scope4');
     $this->shouldThrow(new InvalidScopeException("Scope 'unknown' is invalid."))->during('intersect', ['scope1 scope2 unknown', [$scope1, $scope2, $scope3, $scope4]]);
 }
コード例 #2
0
 function it_should_return_redirect_uri(IAccessToken $accessToken, IScope $scope1, IScope $scope2)
 {
     $accessToken->getExpiresAt()->willReturn(time() + 3600)->shouldBeCalled();
     $accessToken->getId()->willReturn('abcde')->shouldBeCalled();
     $accessToken->getScopes()->willReturn([$scope1, $scope2])->shouldBeCalled();
     $scope1->getId()->willReturn('scope1')->shouldBeCalled();
     $scope2->getId()->willReturn('scope2')->shouldBeCalled();
     $this->getRedirectUri()->shouldReturn('http://google.com#access_token=abcde&expires_in=3600&scope=scope1+scope2&state=state&token_type=Bearer');
 }