$nodes = (new Node\Builder)
->atHost('localhost')
->onPort(8098)
->build()
$riak = new Riak($nodes);
$command = (new Command\Builder\FetchObject($riak))
->buildLocation('username', 'users')
->build();
$response = $command->execute();
$user = $response->getObject();
public function testApi() { $nodes = static::getCluster(); $riak = new Riak($nodes, [], new Riak\Api\Pb()); $api = $riak->getApi(); $this->assertInstanceOf('Basho\\Riak\\Api\\Pb', $api); }
/** * Outputs the caller method name so that accidental connections can be noticed * * Using echo() is safe, since fixtures should be enabled on the command line while running PHPUnit only! * * @return BashoRiak\Node */ public function getActiveNode() { if ($this->usesFixtures()) { echo ' [RIAK CONNECT BY "' . $this->getFixtureCaller(8) . '"] '; } return parent::getActiveNode(); }
/** * Gets the request that was issued to the API by this Command. * * @return string */ public function getRequest() { return $this->riak->getLastRequest(); }
/** * @dataProvider getCluster * @param $nodes array */ public function testApi($nodes) { $riak = new Riak($nodes); $this->assertInstanceOf('Basho\\Riak\\Api', $riak->getApi()); }
public function testApi() { $nodes = static::getCluster(); $riak = new Riak($nodes); $this->assertInstanceOf('Basho\\Riak\\Api', $riak->getApi()); }