/** * @covers WindowsAzure\MediaServices\Templates\TokenClaim::getClaimValue * @covers WindowsAzure\MediaServices\Templates\TokenClaim::setClaimValue */ public function testGetSetClaimValue() { // Setup $entity = new TokenClaim(''); $payload = 'payload string'; // Test $entity->setClaimValue($payload); $result = $entity->getClaimValue(); // Assert $this->assertEquals($payload, $result); }
/** * @param mixed $xmlElement * @return TokenClaim[] Array of TokenClaim */ private static function deserializeRequiredClaims($xmlElement) { $result = array(); foreach ($xmlElement->children() as $child) { if (!isset($child->ClaimType)) { throw new \RuntimeException("The TokenClaim must contains a 'ClaimType' element"); } $claim = new TokenClaim((string) $child->ClaimType); if (isset($child->ClaimValue)) { $claim->setClaimValue((string) $child->ClaimValue); } $result[] = $claim; } return $result; }