public function testCanSpecifyOauth2TypeDuringInstantiation() { $entity = new AuthenticationEntity(AuthenticationEntity::TYPE_OAUTH2); $this->assertFalse($entity->isBasic()); $this->assertFalse($entity->isDigest()); $this->assertTrue($entity->isOAuth2()); }
/** * Determine the route to use for a given entity * * @param AuthenticationEntity $entity * @return string */ protected function getRouteForEntity(AuthenticationEntity $entity) { $baseRoute = 'zf-apigility/api/authentication'; if ($entity->isBasic()) { return $baseRoute . '/http-basic'; } if ($entity->isDigest()) { return $baseRoute . '/http-digest'; } if ($entity->isOAuth2()) { return $baseRoute . '/oauth2'; } return $baseRoute; }