diff --git a/tests/Export/MysqlTestCase.php b/tests/Export/MysqlTestCase.php index 60367fb99..b7fd06a97 100644 --- a/tests/Export/MysqlTestCase.php +++ b/tests/Export/MysqlTestCase.php @@ -233,6 +233,26 @@ class Doctrine_Export_Mysql_TestCase extends Doctrine_UnitTestCase $this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, name VARCHAR(4), INDEX myindex (id ASC, name DESC), PRIMARY KEY(id)) ENGINE = INNODB'); } + public function testCreateTableSupportsFulltextIndexes() + { + $fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true, 'unique' => true), + 'content' => array('type' => 'string', 'length' => 4), + ); + + $options = array('primary' => array('id'), + 'indexes' => array('myindex' => array( + 'fields' => array( + 'content' => array('sorting' => 'DESC') + ), + 'type' => 'fulltext', + )), + 'type' => 'MYISAM', + ); + + $this->export->createTable('sometable', $fields, $options); + + $this->assertEqual($this->adapter->pop(), 'CREATE TABLE sometable (id INT UNSIGNED AUTO_INCREMENT, content VARCHAR(4), FULLTEXT INDEX myindex (content DESC), PRIMARY KEY(id)) ENGINE = MYISAM'); + } } class MysqlTestRecord extends Doctrine_Record { diff --git a/tests/Export/OracleTestCase.php b/tests/Export/OracleTestCase.php index 6eccf8957..ed542bfc4 100644 --- a/tests/Export/OracleTestCase.php +++ b/tests/Export/OracleTestCase.php @@ -123,5 +123,19 @@ class Doctrine_Export_Oracle_TestCase extends Doctrine_UnitTestCase $this->adapter->pop(); $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (id CHAR(3))'); } + public function testCreateTableSupportsIndexes() + { + $fields = array('id' => array('type' => 'integer', 'unsigned' => 1, 'autoincrement' => true, 'unique' => true), + 'name' => array('type' => 'string', 'length' => 4), + ); + + $options = array('primary' => array('id'), + 'indexes' => array('myindex' => array('fields' => array('id', 'name'))) + ); + + $sql =$this->export->createTableSql('sometable', $fields, $options); + + $this->assertEqual($sql, 'CREATE TABLE sometable (id INTEGER UNSIGNED PRIMARY KEY AUTOINCREMENT, name VARCHAR(4), INDEX myindex (id, name))'); + } } ?>