예제 #1
0
 public function testProxyAdapterCanInvertAddIndex()
 {
     $table = new \Phinx\Db\Table('atable');
     $index = new \Phinx\Db\Table\Index();
     $index->setType(\Phinx\Db\Table\Index::INDEX)->setColumns(array('email'));
     $this->adapter->addIndex($table, $index);
     $commands = $this->adapter->getInvertedCommands();
     $this->assertEquals('dropIndex', $commands[0]['name']);
     $this->assertEquals('atable', $commands[0]['arguments'][0]);
     $this->assertContains('email', $commands[0]['arguments'][1]);
 }
 /**
  * Sets the index dbType.
  *
  * @param string $type
  *
  * @return $this
  */
 public function setType($type)
 {
     $this->index->setType($type);
     return $this;
 }