public function testExtensionExists(): void
{ // Check if PG_trgm extension is present.
$this->
assertTrue($this->testingFakeConnection->
schema()->
extensionExists('pg_trgm'
));
// Asserting that the Schema testing_fake exist in the database.
$this->
assertCount(1, \Drupal::
database()->
query("SELECT * FROM pg_catalog.pg_namespace WHERE nspname = 'testing_fake'"
)->
fetchAll());
$this->
assertTrue($this->testingFakeConnection->
schema()->
tableExists('faking_table'
));
// Hardcoded assertion that we created the table in the non-public schema.
$this->
assertCount(1,
$this->testingFakeConnection->
query("SELECT * FROM pg_tables WHERE schemaname = 'testing_fake' AND tablename = :prefixedTable",
[':prefixedTable' =>
$this->testingFakeConnection->
getPrefix() . "faking_table"
])->
fetchAll());
} /**
* @covers ::addField
* @covers ::fieldExists
* @covers ::dropField
* @covers ::changeField
*/
public function testField(): void
{ $this->testingFakeConnection->
schema()->
addField('faking_table', 'added_field',
['type' => 'int', 'not null' => FALSE
]);
$this->
assertTrue($this->testingFakeConnection->
schema()->
fieldExists('faking_table', 'added_field'
));