public function testDropIndexByName() { // single column index $table = new \Phinx\Db\Table('table1', array(), $this->adapter); $table->addColumn('email', 'string')->addIndex('email', array('name' => 'myemailindex'))->save(); $this->assertTrue($table->hasIndex('email')); $this->adapter->dropIndexByName($table->getName(), 'myemailindex'); $this->assertFalse($table->hasIndex('email')); // multiple column index $table2 = new \Phinx\Db\Table('table2', array(), $this->adapter); $table2->addColumn('fname', 'string')->addColumn('lname', 'string')->addIndex(array('fname', 'lname'), array('name' => 'twocolumnuniqueindex', 'unique' => true))->save(); $this->assertTrue($table2->hasIndex(array('fname', 'lname'))); $this->adapter->dropIndexByName($table2->getName(), 'twocolumnuniqueindex'); $this->assertFalse($table2->hasIndex(array('fname', 'lname'))); }