/** * Test command builder construct * * @dataProvider getLocalNodeConnection * * @param $riak \Basho\Riak */ public function testFetch($riak) { // build an object $builder = new Command\Builder\FetchObject($riak); $builder->buildLocation('some_key', 'some_bucket'); $command = $builder->build(); $this->assertInstanceOf('Basho\\Riak\\Command\\Object\\Fetch', $command); $this->assertInstanceOf('Basho\\Riak\\Bucket', $command->getBucket()); $this->assertInstanceOf('Basho\\Riak\\Location', $command->getLocation()); $this->assertEquals('some_bucket', $command->getBucket()->getName()); $this->assertEquals('default', $command->getBucket()->getType()); $this->assertEquals('some_key', $command->getLocation()->getKey()); $builder->buildLocation('some_key', 'some_bucket', 'some_type'); $command = $builder->build(); $this->assertEquals('some_type', $command->getBucket()->getType()); $headers = $builder->getHeaders(); $this->assertTrue(isset($headers['Accept'])); $this->assertEquals('multipart/mixed, */*', $headers['Accept']); }