예제 #1
0
 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());
 }
예제 #2
0
 public function testBuildCommand()
 {
     $builder = FetchSet::builder()->withLocation($this->location)->withIncludeContext(true)->withNotFoundOk(true)->withPr(2)->withR(2);
     $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\FetchSet', $builder->build());
 }