@@ 105-116 (lines=12) @@ | ||
102 | $table = new Table("foo", $columns, array(), array()); |
|
103 | } |
|
104 | ||
105 | public function testCreateIndex() |
|
106 | { |
|
107 | $type = \Doctrine\DBAL\Types\Type::getType('integer'); |
|
108 | $columns = array(new Column("foo", $type), new Column("bar", $type), new Column("baz", $type)); |
|
109 | $table = new Table("foo", $columns); |
|
110 | ||
111 | $table->addIndex(array("foo", "bar"), "foo_foo_bar_idx"); |
|
112 | $table->addUniqueIndex(array("bar", "baz"), "foo_bar_baz_uniq"); |
|
113 | ||
114 | $this->assertTrue($table->hasIndex("foo_foo_bar_idx")); |
|
115 | $this->assertTrue($table->hasIndex("foo_bar_baz_uniq")); |
|
116 | } |
|
117 | ||
118 | public function testIndexCaseInsensitive() |
|
119 | { |
|
@@ 118-133 (lines=16) @@ | ||
115 | $this->assertTrue($table->hasIndex("foo_bar_baz_uniq")); |
|
116 | } |
|
117 | ||
118 | public function testIndexCaseInsensitive() |
|
119 | { |
|
120 | $type = \Doctrine\DBAL\Types\Type::getType('integer'); |
|
121 | $columns = array( |
|
122 | new Column("foo", $type), |
|
123 | new Column("bar", $type), |
|
124 | new Column("baz", $type) |
|
125 | ); |
|
126 | $table = new Table("foo", $columns); |
|
127 | ||
128 | $table->addIndex(array("foo", "bar", "baz"), "Foo_Idx"); |
|
129 | ||
130 | $this->assertTrue($table->hasIndex('foo_idx')); |
|
131 | $this->assertTrue($table->hasIndex('Foo_Idx')); |
|
132 | $this->assertTrue($table->hasIndex('FOO_IDX')); |
|
133 | } |
|
134 | ||
135 | public function testAddIndexes() |
|
136 | { |