public function testStoreAndFetchSet() { $store = StoreSet::builder()->withLocation($this->location)->withReturnBody(true)->add("Ottawa")->add("Toronto")->withPw(2)->withDw(2)->withW(3)->build(); $fetch = FetchSet::builder()->withLocation($this->location)->withNotFoundOk(true)->withPr(1)->withR(1)->build(); $storeResponse = $this->client->execute($store); $fetchResponse = $this->client->execute($fetch); $set = $fetchResponse->getDatatype(); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\Response\\StoreSetResponse', $storeResponse); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\Response\\FetchSetResponse', $fetchResponse); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Crdt\\RiakSet', $set); $this->assertEquals($this->location, $fetchResponse->getLocation()); $this->assertEquals(["Ottawa", "Toronto"], $set->getValue()); }
public function testBuildCommand() { $builder = StoreSet::builder($this->location, [])->withLocation($this->location)->add(new RiakCounter(1))->remove(new RiakCounter(1))->add(new RiakCounter(2))->withContext('context-hash')->withReturnBody(true)->withDw(1)->withPw(2)->withW(3)->build(); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\StoreSet', $builder); }