| @@ 140-152 (lines=13) @@ | ||
| 137 | $this->assertFalse($this->adapter->hasIndex('table1', array('tag_id', 'user_email'))); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testCreateTableWithMultipleIndexes() |
|
| 141 | { |
|
| 142 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 143 | $table->addColumn('email', 'string') |
|
| 144 | ->addColumn('name', 'string') |
|
| 145 | ->addIndex('email') |
|
| 146 | ->addIndex('name') |
|
| 147 | ->save(); |
|
| 148 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 149 | $this->assertTrue($this->adapter->hasIndex('table1', array('name'))); |
|
| 150 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 151 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_name'))); |
|
| 152 | } |
|
| 153 | ||
| 154 | public function testCreateTableWithUniqueIndexes() |
|
| 155 | { |
|
| @@ 160-172 (lines=13) @@ | ||
| 157 | $this->assertFalse($this->adapter->hasIndex('table1', array('tag_id', 'user_email'))); |
|
| 158 | } |
|
| 159 | ||
| 160 | public function testCreateTableWithMultipleIndexes() |
|
| 161 | { |
|
| 162 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 163 | $table->addColumn('email', 'string') |
|
| 164 | ->addColumn('name', 'string') |
|
| 165 | ->addIndex('email') |
|
| 166 | ->addIndex('name') |
|
| 167 | ->save(); |
|
| 168 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 169 | $this->assertTrue($this->adapter->hasIndex('table1', array('name'))); |
|
| 170 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 171 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_name'))); |
|
| 172 | } |
|
| 173 | ||
| 174 | public function testCreateTableWithUniqueIndexes() |
|
| 175 | { |
|
| @@ 235-247 (lines=13) @@ | ||
| 232 | $this->assertFalse($this->adapter->hasIndex('table1', array('tag_id', 'user_email'))); |
|
| 233 | } |
|
| 234 | ||
| 235 | public function testCreateTableWithMultipleIndexes() |
|
| 236 | { |
|
| 237 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 238 | $table->addColumn('email', 'string') |
|
| 239 | ->addColumn('name', 'string') |
|
| 240 | ->addIndex('email') |
|
| 241 | ->addIndex('name') |
|
| 242 | ->save(); |
|
| 243 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 244 | $this->assertTrue($this->adapter->hasIndex('table1', array('name'))); |
|
| 245 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 246 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_name'))); |
|
| 247 | } |
|
| 248 | ||
| 249 | public function testCreateTableWithUniqueIndexes() |
|
| 250 | { |
|
| @@ 191-203 (lines=13) @@ | ||
| 188 | $this->assertFalse($this->adapter->hasIndex('table1', array('tag_id', 'user_email'))); |
|
| 189 | } |
|
| 190 | ||
| 191 | public function testCreateTableWithMultipleIndexes() |
|
| 192 | { |
|
| 193 | $table = new \Phinx\Db\Table('table1', array(), $this->adapter); |
|
| 194 | $table->addColumn('email', 'string') |
|
| 195 | ->addColumn('name', 'string') |
|
| 196 | ->addIndex('email') |
|
| 197 | ->addIndex('name') |
|
| 198 | ->save(); |
|
| 199 | $this->assertTrue($this->adapter->hasIndex('table1', array('email'))); |
|
| 200 | $this->assertTrue($this->adapter->hasIndex('table1', array('name'))); |
|
| 201 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_email'))); |
|
| 202 | $this->assertFalse($this->adapter->hasIndex('table1', array('email', 'user_name'))); |
|
| 203 | } |
|
| 204 | ||
| 205 | public function testCreateTableWithUniqueIndexes() |
|
| 206 | { |
|