| @@ 259-268 (lines=10) @@ | ||
| 256 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 257 | } |
|
| 258 | ||
| 259 | public function testCreateTableWithNamedIndex() |
|
| 260 | { |
|
| 261 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 262 | $table->addColumn('email', 'string') |
|
| 263 | ->addIndex('email', array('name' => 'myemailindex')) |
|
| 264 | ->save(); |
|
| 265 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 266 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 267 | $this->assertTrue($this->adapter->hasIndexByName('table1', 'myemailindex')); |
|
| 268 | } |
|
| 269 | ||
| 270 | public function testCreateTableWithMultiplePKsAndUniqueIndexes() |
|
| 271 | { |
|
| @@ 164-173 (lines=10) @@ | ||
| 161 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 162 | } |
|
| 163 | ||
| 164 | public function testCreateTableWithNamedIndexes() |
|
| 165 | { |
|
| 166 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 167 | $table->addColumn('email', 'string') |
|
| 168 | ->addIndex('email', array('name' => 'myemailindex')) |
|
| 169 | ->save(); |
|
| 170 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 171 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 172 | $this->assertTrue($this->adapter->hasIndexByName('table1', 'myemailindex')); |
|
| 173 | } |
|
| 174 | ||
| 175 | public function testCreateTableWithMultiplePKsAndUniqueIndexes() |
|
| 176 | { |
|
| @@ 184-193 (lines=10) @@ | ||
| 181 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 182 | } |
|
| 183 | ||
| 184 | public function testCreateTableWithNamedIndexes() |
|
| 185 | { |
|
| 186 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 187 | $table->addColumn('email', 'string') |
|
| 188 | ->addIndex('email', array('name' => 'myemailindex')) |
|
| 189 | ->save(); |
|
| 190 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 191 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 192 | $this->assertTrue($this->adapter->hasIndexByName('table1', 'myemailindex')); |
|
| 193 | } |
|
| 194 | ||
| 195 | public function testRenameTable() |
|
| 196 | { |
|
| @@ 215-224 (lines=10) @@ | ||
| 212 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 213 | } |
|
| 214 | ||
| 215 | public function testCreateTableWithNamedIndexes() |
|
| 216 | { |
|
| 217 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 218 | $table->addColumn('email', 'string') |
|
| 219 | ->addIndex('email', array('name' => 'myemailindex')) |
|
| 220 | ->save(); |
|
| 221 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 222 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 223 | $this->assertTrue($this->adapter->hasIndexByName('table1', 'myemailindex')); |
|
| 224 | } |
|
| 225 | ||
| 226 | public function testRenameTable() |
|
| 227 | { |
|