/** 
  * @covers WindowsAzure\Common\Internal\Atom\AtomLink::getType
  * @covers WindowsAzure\Common\Internal\Atom\AtomLink::setType
  */
 public function testGetSetType()
 {
     // Setup
     $expected = 'testType';
     $atomLink = new AtomLink();
     // Test
     $atomLink->setType($expected);
     $actual = $atomLink->getType();
     // Assert
     $this->assertEquals($expected, $actual);
 }
 /**
  * Create new IngestManifestAsset
  *
  * @param Models\IngestManifestAsset $ingestManifestAsset An IngestManifestAsset
  * data
  *
  * @param Models\Asset               $asset               An Asset data to be
  * linked with IngestManifestAsset
  *
  * @return WindowsAzure\MediaServices\Models\IngestManifestAsset
  */
 public function createIngestManifestAsset($ingestManifestAsset, $asset)
 {
     Validate::isA($ingestManifestAsset, 'WindowsAzure\\Mediaservices\\Models\\IngestManifestAsset', 'ingestManifestAsset');
     Validate::isA($asset, 'WindowsAzure\\Mediaservices\\Models\\Asset', 'asset');
     $href = urlencode($asset->getId());
     $atomLink = new AtomLink();
     $atomLink->setHref($this->getUri() . "Assets('{$href}')");
     $atomLink->setType(Resources::ATOM_ENTRY_CONTENT_TYPE);
     $atomLink->setTitle('Asset');
     $atomLink->setRel(Resources::MEDIA_SERVICES_ASSET_REL);
     return IngestManifestAsset::createFromOptions($this->_createEntity($ingestManifestAsset, 'IngestManifestAssets', array($atomLink)));
 }
 /**
  * Create a job HTTP call context.
  *
  * @param WindowsAzure\MediaServices\Models\Job $job         Job data
  * @param array                                 $inputAssets Input assets list
  *
  * @return WindowsAzure\Common\Internal\Http\HttpCallContext
  */
 private function _getCreateEmptyJobContext($job, $inputAssets)
 {
     Validate::isA($job, 'WindowsAzure\\MediaServices\\Models\\Job', 'job');
     Validate::isArray($inputAssets, 'inputAssets');
     $atomLinks = array();
     foreach ($inputAssets as $inputAsset) {
         Validate::isA($inputAsset, 'WindowsAzure\\MediaServices\\Models\\Asset', 'inputAssets');
         $href = urlencode($inputAsset->getId());
         $atomLink = new AtomLink();
         $atomLink->setHref($this->getUri() . "Assets('{$href}')");
         $atomLink->setType(Resources::ATOM_FEED_CONTENT_TYPE);
         $atomLink->setTitle('InputAssets');
         $atomLink->setRel(Resources::MEDIA_SERVICES_INPUT_ASSETS_REL);
         $atomLinks[] = $atomLink;
     }
     $result = new HttpCallContext();
     $result->setMethod(Resources::HTTP_POST);
     $result->setHeaders($this->_batchHeaders);
     $result->setUri($this->getUri());
     $result->setPath('/Jobs');
     $result->setBody($this->wrapAtomEntry($job, $atomLinks));
     $result->addStatusCode(Resources::STATUS_CREATED);
     return $result;
 }