function PostgreSqlSequenceUpdateTest::testPostgreSqlSequenceUpdate

Same name in other branches
  1. 11.x core/modules/pgsql/tests/src/Functional/Database/PostgreSqlSequenceUpdateTest.php \Drupal\Tests\pgsql\Functional\Database\PostgreSqlSequenceUpdateTest::testPostgreSqlSequenceUpdate()

Asserts that a newly created sequence has the correct ownership.

File

core/modules/pgsql/tests/src/Functional/Database/PostgreSqlSequenceUpdateTest.php, line 53

Class

PostgreSqlSequenceUpdateTest
Tests that any unowned sequences created previously have a table owner.

Namespace

Drupal\Tests\pgsql\Functional\Database

Code

public function testPostgreSqlSequenceUpdate() : void {
    $this->assertFalse($this->getSequenceOwner('pgsql_sequence_test', 'sequence_field'));
    // Run the updates.
    $this->runUpdates();
    $seq_owner = $this->getSequenceOwner('pgsql_sequence_test', 'sequence_field');
    $this->assertEquals($this->connection
        ->getPrefix() . 'pgsql_sequence_test', $seq_owner->table_name);
    $this->assertEquals('sequence_field', $seq_owner->field_name, 'Sequence is owned by the table and column.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.