/** * @covers ::checkCollationMismatchBetweenTableAndColumns */ public function testCheckCollationMismatchBetweenTableAndColumns() { $columns = new Table\ColumnCollection(); $columns->add(new Table\Column(['Field' => 'username', 'Type' => null, 'Collation' => 'utf8_danish_ci', 'Null' => null, 'Key' => null, 'Default' => null, 'Extra' => null])); $columns->add(new Table\Column(['Field' => 'first_name', 'Type' => null, 'Collation' => 'utf8_danish_ci', 'Null' => null, 'Key' => null, 'Default' => null, 'Extra' => null])); $columns->add(new Table\Column(['Field' => 'last_name', 'Type' => null, 'Collation' => 'utf8_unicode_ci', 'Null' => null, 'Key' => null, 'Default' => null, 'Extra' => null])); /** * Table */ $table = new Table(null, 'utf8_unicode_ci', new Table\ColumnCollection(), new Table\IndexCollection()); $result = $table->checkCollationMismatchBetweenTableAndColumns($columns); $expected = [['type' => 'column', 'key' => 'username', 'description' => 'Column is not using same collation as table'], ['type' => 'column', 'key' => 'first_name', 'description' => 'Column is not using same collation as table']]; $this->assertSame($expected, $result); }