Doctrine\Tests\Search\ElasticSearch\ClientTest::testCreateIndex PHP Method

testCreateIndex() public method

public testCreateIndex ( )
    public function testCreateIndex()
    {
        $index = $this->getMockBuilder('Elastica\\Index')->disableOriginalConstructor()->setMethods(array('create'))->getMock();
        $index->expects($this->once())->method('create')->with(array('foo' => 'bar'), true);
        $this->elasticaClient->expects($this->once())->method('getIndex')->with('comments')->will($this->returnValue($index));
        $this->client->createIndex('comments', array('foo' => 'bar'));
    }