/**
  * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::getGracePeriod
  * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::setGracePeriod
  */
 public function testGetSetGracePeriod()
 {
     // Setup
     $entity = new PlayReadyLicenseTemplate();
     $payload = new \DateInterval('PT30S');
     // Test
     $entity->setGracePeriod($payload);
     $result = $entity->getGracePeriod();
     // 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();
 }