mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Add a basic test to ensure we throw an exception when no scope is given
This commit is contained in:
		@@ -459,6 +459,21 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
 | 
			
		||||
        $grantMock->validateScopes('basic   ');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @expectedException     \League\OAuth2\Server\Exception\OAuthServerException
 | 
			
		||||
     * @expectedExceptionCode 11
 | 
			
		||||
     */
 | 
			
		||||
    public function testValidateScopesMissingScope()
 | 
			
		||||
    {
 | 
			
		||||
        $scopeRepositoryMock = $this->getMockBuilder(ScopeRepositoryInterface::class)->getMock();
 | 
			
		||||
        $scopeRepositoryMock->method('getScopeEntityByIdentifier')->willReturn(null);
 | 
			
		||||
 | 
			
		||||
        $grantMock = $this->getMockForAbstractClass(AbstractGrant::class);
 | 
			
		||||
        $grantMock->setScopeRepository($scopeRepositoryMock);
 | 
			
		||||
 | 
			
		||||
        $grantMock->validateScopes('');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testGenerateUniqueIdentifier()
 | 
			
		||||
    {
 | 
			
		||||
        $grantMock = $this->getMockForAbstractClass(AbstractGrant::class);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user