Basho\Tests\HllOperationsTest::testAddNewWithKey PHP Method

testAddNewWithKey() public method

public testAddNewWithKey ( )
    public function testAddNewWithKey()
    {
        $command = (new Command\Builder\UpdateHll(static::$riak))->add('Sabres')->add('Canadiens')->add('Bruins')->add('Maple Leafs')->add('Senators')->add('Red Wings')->add('Thrashers')->buildLocation(static::$key, 'Teams', static::HLL_BUCKET_TYPE)->build();
        $response = $command->execute();
        // expects 204 - No Content
        // this is wonky, its not 201 because the key may have been generated on another node
        $this->assertEquals('204', $response->getCode());
        $this->assertEmpty($response->getLocation());
        $command = (new Command\Builder\FetchHll(static::$riak))->buildLocation(static::$key, 'Teams', static::HLL_BUCKET_TYPE)->build();
        $response = $command->execute();
        $this->assertEquals('200', $response->getCode());
        $this->assertInstanceOf('Basho\\Riak\\DataType\\Hll', $response->getHll());
        $this->assertNotEmpty($response->getHll()->getData());
        $this->assertTrue(is_int($response->getHll()->getData()));
        $this->assertEquals(7, $response->getHll()->getData());
    }