// Create a table with a field type not defined in
// \Drupal\Core\Database\Schema::getFieldTypeMap.
$table_name =
$connection->
getPrefix() . 'foo';
$sql = "create table if not exists `
$table_name` (`test` datetime NOT NULL);";
$connection->
query($sql)->
execute();
} /**
* Tests the command directly.
*/
public function testDbDumpCommand() { $command =
new DbDumpCommand();
$command_tester =
new CommandTester($command);
$command_tester->
execute([]);
// Assert that insert exists and that some expected fields exist.
$output =
$command_tester->
getDisplay();
$this->
assertStringContainsString("createTable('router",
$output, 'Table router found'
);
$this->
assertStringContainsString("insert('router",
$output, 'Insert found'
);
$this->
assertStringContainsString("'name' => 'test",
$output, 'Insert name field found'
);
$this->
assertStringContainsString("'path' => 'test",
$output, 'Insert path field found'
);
$this->
assertStringContainsString("'pattern_outline' => 'test",
$output, 'Insert pattern_outline field found'
);
$this->
assertStringContainsString("// phpcs:ignoreFile",
$output);