@@ 454-461 (lines=8) @@ | ||
451 | } |
|
452 | } |
|
453 | ||
454 | public function columnExists() |
|
455 | { |
|
456 | foreach ($this->columns as $column) { |
|
457 | list($tableName, $columnName) = explode('.', $column); |
|
458 | $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1; |
|
459 | $this->I->assertTrue($exists, 'カラムがあるはず '.$column); |
|
460 | } |
|
461 | } |
|
462 | ||
463 | public function columnNotExists() |
|
464 | { |
|
@@ 463-470 (lines=8) @@ | ||
460 | } |
|
461 | } |
|
462 | ||
463 | public function columnNotExists() |
|
464 | { |
|
465 | foreach ($this->columns as $column) { |
|
466 | list($tableName, $columnName) = explode('.', $column); |
|
467 | $exists = $this->conn->executeQuery("SELECT count(*) AS count FROM information_schema.columns WHERE table_name = '${tableName}' AND column_name = '${columnName}';")->fetch()['count'] == 1; |
|
468 | $this->I->assertFalse($exists, 'カラムがないはず '.$column); |
|
469 | } |
|
470 | } |
|
471 | ||
472 | public function traitExists() |
|
473 | { |