/**
  * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::getExpirationDate
  * @covers WindowsAzure\MediaServices\Templates\PlayReadyLicenseTemplate::setExpirationDate
  */
 public function testGetSetExpirationDate()
 {
     // Setup
     $entity = new PlayReadyLicenseTemplate();
     $payload = new \DateTime('now');
     // Test
     $entity->setExpirationDate($payload);
     $result = $entity->getExpirationDate();
     // 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();
 }