/** * Get ContentKey. * * @param Models\ContentKey|string $contentKey An ContentKey data or * ContentKey Id * * @return Models\ContentKey */ public function getContentKey($contentKey) { $contentKeyId = Utilities::getEntityId($contentKey, 'WindowsAzure\\Mediaservices\\Models\\ContentKey'); return ContentKey::createFromOptions($this->_getEntity("ContentKeys('{$contentKeyId}')")); }
/** * @covers WindowsAzure\MediaServices\Models\ContentKey::getLastModified */ public function testGetLastModified() { // Setup $options = array('LastModified' => '2013-02-26'); $modified = new \Datetime($options['LastModified']); $contentKey = ContentKey::createFromOptions($options); // Test $result = $contentKey->getLastModified(); // Assert $this->assertEquals($modified->getTimestamp(), $result->getTimestamp()); }