exists() public method

Checks if the given index template is already created.
public exists ( ) : boolean
return boolean True if index exists
 /**
  * @group functional
  */
 public function testCreateTemplate()
 {
     $template = array('template' => 'te*', 'settings' => array('number_of_shards' => 1));
     $name = 'index_template1';
     $indexTemplate = new IndexTemplate($this->_getClient(), $name);
     $indexTemplate->create($template);
     $this->assertTrue($indexTemplate->exists());
     $indexTemplate->delete();
     $this->assertFalse($indexTemplate->exists());
 }