@@ 113-124 (lines=12) @@ | ||
110 | $table = new Table('foo', $columns, [], []); |
|
111 | } |
|
112 | ||
113 | public function testCreateIndex() : void |
|
114 | { |
|
115 | $type = Type::getType('integer'); |
|
116 | $columns = [new Column('foo', $type), new Column('bar', $type), new Column('baz', $type)]; |
|
117 | $table = new Table('foo', $columns); |
|
118 | ||
119 | $table->addIndex(['foo', 'bar'], 'foo_foo_bar_idx'); |
|
120 | $table->addUniqueIndex(['bar', 'baz'], 'foo_bar_baz_uniq'); |
|
121 | ||
122 | self::assertTrue($table->hasIndex('foo_foo_bar_idx')); |
|
123 | self::assertTrue($table->hasIndex('foo_bar_baz_uniq')); |
|
124 | } |
|
125 | ||
126 | public function testIndexCaseInsensitive() : void |
|
127 | { |
|
@@ 126-141 (lines=16) @@ | ||
123 | self::assertTrue($table->hasIndex('foo_bar_baz_uniq')); |
|
124 | } |
|
125 | ||
126 | public function testIndexCaseInsensitive() : void |
|
127 | { |
|
128 | $type = Type::getType('integer'); |
|
129 | $columns = [ |
|
130 | new Column('foo', $type), |
|
131 | new Column('bar', $type), |
|
132 | new Column('baz', $type), |
|
133 | ]; |
|
134 | $table = new Table('foo', $columns); |
|
135 | ||
136 | $table->addIndex(['foo', 'bar', 'baz'], 'Foo_Idx'); |
|
137 | ||
138 | self::assertTrue($table->hasIndex('foo_idx')); |
|
139 | self::assertTrue($table->hasIndex('Foo_Idx')); |
|
140 | self::assertTrue($table->hasIndex('FOO_IDX')); |
|
141 | } |
|
142 | ||
143 | public function testAddIndexes() : void |
|
144 | { |