/**
* @group unit
*/
public function testExists()
{
$name = 'index_template1';
$response = new Response('');
$response->setTransferInfo(array('http_code' => 200));
/** @var \PHPUnit_Framework_MockObject_MockObject|Client $clientMock */
$clientMock = $this->getMock('\\Elastica\\Client', array('request'));
$clientMock->expects($this->once())->method('request')->with('/_template/' . $name, Request::HEAD, array(), array())->willReturn($response);
$indexTemplate = new IndexTemplate($clientMock, $name);
$this->assertTrue($indexTemplate->exists());
}