/** * @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())); }
public function testHasAllowedScope() { $client = new Client(['id' => 'pablodip', 'allowedScopes' => ['foo']]); $this->assertTrue($client->hasAllowedScope('foo')); $this->assertFalse($client->hasAllowedScope('bar')); }
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()); }