/**
  * @return Client
  */
 public function add(Client $client)
 {
     $persistedClient = new PersistentClient($this->filterParamsFromDomain($client->getParams()));
     $this->em->persist($persistedClient);
     $this->em->flush();
     return new Client($this->filterParamsToDomain($persistedClient->getParams()));
 }
Exemplo n.º 2
0
 public function testHasAllowedScope()
 {
     $client = new Client(['id' => 'pablodip', 'allowedScopes' => ['foo']]);
     $this->assertTrue($client->hasAllowedScope('foo'));
     $this->assertFalse($client->hasAllowedScope('bar'));
 }
Exemplo n.º 3
0
 public function testConstructorFullParameters()
 {
     $params = ['id' => 'paolo', 'secret' => 'foo', 'allowedGrantTypes' => array('password'), 'allowedScopes' => array('read'), 'defaultScope' => 'bar'];
     $client = new \Akamon\OAuth2\Server\Domain\Model\Client\Client($params);
     $this->assertSame($params, $client->getParams());
 }