/** * @depends testCreatesDomain */ public function testAddsItem() { $this->client->putAttributes(array('DomainName' => $this->domainName, 'ItemName' => 'test', 'Attributes' => array(array('Name' => 'a', 'Value' => 1, 'Replace' => true), array('Name' => 'b', 'Value' => 2)))); $result = $this->client->getAttributes(array('DomainName' => $this->domainName, 'ItemName' => 'test', 'Attributes' => array('a', 'b'), 'ConsistentRead' => true)); $this->assertEquals('b', $result->getPath('Attributes/0/Name')); $this->assertEquals('2', $result->getPath('Attributes/0/Value')); $this->assertEquals('a', $result->getPath('Attributes/1/Name')); $this->assertEquals('1', $result->getPath('Attributes/1/Value')); $this->assertArrayHasKey('ResponseMetadata', $result->toArray()); }
/** * {@inheritDoc} */ public function insert($storageName, $key, array $data) { $this->createDomain($storageName); $this->client->putAttributes(array('DomainName' => $storageName, 'ItemName' => $key, 'Attributes' => $this->makeAttributes($data))); }