/** * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::getPlayRight * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::setPlayRight */ public function testGetSetPlayRight() { // Setup $entity = new PlayReadyLicenseTemplate(); $payload = new PlayReadyPlayRight(); // Test $entity->setPlayRight($payload); $result = $entity->getPlayRight(); // Assert $this->assertEquals($payload, $result); }
/** * @param \XMLWriter $writer XML writer * @param PlayReadyLicenseTemplate $template */ private static function serializeLicenseTemplate($writer, $template) { $writer->startElement('PlayReadyLicenseTemplate'); if ($template->getAllowTestDevices()) { $writer->writeElement('AllowTestDevices', 'true'); } if ($template->getBeginDate() != null) { $writer->writeElement('BeginDate', $template->getBeginDate()->format(\DateTime::ATOM)); } self::serializeContentKey($writer, $template->getContentKey()); if ($template->getExpirationDate() != null) { $writer->writeElement('ExpirationDate', $template->getExpirationDate()->format(\DateTime::ATOM)); } if ($template->getGracePeriod() != null) { $writer->writeElement('GracePeriod', self::getSpecString($template->getGracePeriod())); } if ($template->getLicenseType()) { $writer->writeElement('LicenseType', (string) $template->getLicenseType()); } self::serializePlayRight($writer, $template->getPlayRight()); if ($template->getRelativeBeginDate() != null) { $writer->writeElement('RelativeBeginDate', self::getSpecString($template->getRelativeBeginDate())); } if ($template->getRelativeExpirationDate() != null) { $writer->writeElement('RelativeExpirationDate', self::getSpecString($template->getRelativeExpirationDate())); } $writer->endElement(); }