private function getMissingIndexesByTable() { $missingIndexesByTable = []; foreach ($this->db->listTables() as $tableName) { $missingIndexes = $this->db->listMissingForeignKeyIndexes($tableName); if (count($missingIndexes)) { $missingIndexesByTable[$tableName] = $missingIndexes; } } return $missingIndexesByTable; }
public function testListTablesReturnsSingleColumnArrayWithTableNames() { $tables = $this->db->listTables(); $stringValues = true; $numKeys = true; foreach ($tables as $key => $table) { if (!is_int($key)) { $numKeys = false; } if (!is_string($table)) { $stringValues = false; } } $this->assertTrue($numKeys); $this->assertTrue($stringValues); $this->assertTrue(in_array('dewdrop_test_fruits', $tables)); }
/** * Check to see if the changelog table exists in the database already. * * @return bool */ protected function tableExists() { return in_array($this->tableName, $this->dbAdapter->listTables()); }