public function testBuildCommand() { $builder = FetchMap::builder()->withLocation($this->location)->withIncludeContext(true)->withNotFoundOk(true)->withPr(2)->withR(2); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\FetchMap', $builder->build()); }
public function testUpdateMapUsingContext() { $storeRespose1 = $this->client->execute(StoreMap::builder()->withIncludeContext(true)->withReturnBody(true)->withLocation($this->location)->updateRegister('username', 'FabioBatSilva')->updateFlag('active', false)->build()); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\Response\\StoreMapResponse', $storeRespose1); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Crdt\\RiakMap', $storeRespose1->getDataType()); $this->assertInternalType('string', $storeRespose1->getContext()); $store2Response = $this->client->execute(StoreMap::builder()->withIncludeContext(true)->withReturnBody(true)->withContext($storeRespose1->getContext())->withLocation($this->location)->updateCounter('clicks', 1)->updateFlag('active', true)->build()); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\Response\\StoreMapResponse', $store2Response); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Crdt\\RiakMap', $store2Response->getDataType()); $this->assertInternalType('string', $store2Response->getContext()); $fetchResponse = $this->client->execute(FetchMap::builder()->withIncludeContext(true)->withLocation($this->location)->build()); $this->assertInstanceOf('Riak\\Client\\Command\\DataType\\Response\\FetchMapResponse', $fetchResponse); $this->assertInstanceOf('Riak\\Client\\Core\\Query\\Crdt\\RiakMap', $fetchResponse->getDataType()); $this->assertInternalType('string', $fetchResponse->getContext()); }