Basho\Tests\SearchOperationsTest::testDeleteIndex PHP Method

testDeleteIndex() public method

public testDeleteIndex ( )
    public function testDeleteIndex()
    {
        $command = (new Command\Builder\Search\DeleteIndex(static::$riak))->withName(static::INDEX)->build();
        $response = $command->execute();
        $this->assertEquals('204', $response->getCode(), $response->getMessage());
        $command = (new Command\Builder\Search\FetchIndex(static::$riak))->withName(static::INDEX)->build();
        $response = $command->execute();
        // indexes take time to propagate between solr and Riak
        $attempts = 1;
        while ($response->getCode() != '404' || $attempts <= 5) {
            sleep(1);
            $response = $command->execute();
            $attempts++;
        }
        $this->assertEquals('404', $response->getCode(), $response->getMessage());
    }