/** * Create InsertEntityResult object from HTTP response parts. * * @param string $body The HTTP response body. * @param array $headers The HTTP response headers. * @param IAtomReaderWriter $atomSerializer The atom reader and writer. * * @return \MicrosoftAzure\Storage\Table\Models\InsertEntityResult * * @static */ public static function create($body, $headers, $atomSerializer) { $result = new InsertEntityResult(); $entity = $atomSerializer->parseEntity($body); $entity->setETag(Utilities::tryGetValue($headers, Resources::ETAG)); $result->setEntity($entity); return $result; }
/** * @covers MicrosoftAzure\Storage\Table\Models\InsertEntityResult::setEntity * @covers MicrosoftAzure\Storage\Table\Models\InsertEntityResult::getEntity */ public function testSetEntity() { // Setup $result = new InsertEntityResult(); $entity = new Entity(); // Test $result->setEntity($entity); // Assert $this->assertEquals($entity, $result->getEntity()); }