public function testValidatingRequestWithNoScopesUsesOriginalScopes()
 {
     $validator = new ScopeValidator(Request::create('test', 'POST'), $storage = $this->getStorageMock());
     $storage->shouldReceive('get')->once()->with('foo')->andReturn(new ScopeEntity('foo', 'foo', 'foo'));
     $storage->shouldReceive('get')->once()->with('bar')->andReturn(new ScopeEntity('bar', 'bar', 'bar'));
     $scopes = $validator->validate(['foo' => [], 'bar' => []]);
     $this->assertArrayHasKey('foo', $scopes);
     $this->assertArrayHasKey('bar', $scopes);
 }
Esempio n. 2
0
 /**
  * Validate the requested scopes.
  * 
  * @param  array  $originalScopes
  * @return array
  */
 protected function validateScopes(array $originalScopes = [])
 {
     return $this->scopeValidator->validate($originalScopes);
 }