Schema example

public function testDeprecationInsert() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\pgsql\Insert is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module. See https://www.drupal.org/node/3129492');
    $insert = new Insert($this->connection, 'test');
    $this->assertInstanceOf(Insert::class$insert);
  }

  /** * @covers Drupal\Core\Database\Driver\pgsql\Schema */
  public function testDeprecationSchema() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\pgsql\Schema is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module. See https://www.drupal.org/node/3129492');
    $schema = new Schema($this->connection);
    $this->assertInstanceOf(Schema::class$schema);
  }

  /** * @covers Drupal\Core\Database\Driver\pgsql\Select */
  public function testDeprecationSelect() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\pgsql\Select is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module. See https://www.drupal.org/node/3129492');
    $select = new Select($this->connection, 'test');
    $this->assertInstanceOf(Select::class$select);
  }

  
public function testDeprecationInsert() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\sqlite\Insert is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The SQLite database driver has been moved to the sqlite module. See https://www.drupal.org/node/3129492');
    $insert = new Insert($this->connection, 'test');
    $this->assertInstanceOf(Insert::class$insert);
  }

  /** * @covers Drupal\Core\Database\Driver\sqlite\Schema */
  public function testDeprecationSchema() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\sqlite\Schema is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The SQLite database driver has been moved to the sqlite module. See https://www.drupal.org/node/3129492');
    $schema = new Schema($this->connection);
    $this->assertInstanceOf(Schema::class$schema);
  }

  /** * @covers Drupal\Core\Database\Driver\sqlite\Select */
  public function testDeprecationSelect() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\sqlite\Select is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The SQLite database driver has been moved to the sqlite module. See https://www.drupal.org/node/3129492');
    $select = new Select($this->connection, 'test');
    $this->assertInstanceOf(Select::class$select);
  }

  

  public function testComputedConstraintName($table_name$name$expected) {
    $max_identifier_length = 63;
    $schema = new Schema($this->connection);

    $statement = $this->createMock('\Drupal\Core\Database\StatementInterface');
    $statement->expects($this->any())
      ->method('fetchField')
      ->willReturn($max_identifier_length);

    $this->connection->expects($this->exactly(2))
      ->method('query')
      ->withConsecutive(
        [$this->anything()],
        ["SELECT 1 FROM pg_constraint WHERE conname = '$expected'"],
      )
public function testDeprecationInsert() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\mysql\Insert is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module. See https://www.drupal.org/node/3129492');
    $insert = new Insert($this->connection, 'test');
    $this->assertInstanceOf(Insert::class$insert);
  }

  /** * @covers Drupal\Core\Database\Driver\mysql\Schema */
  public function testDeprecationSchema() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\mysql\Schema is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module. See https://www.drupal.org/node/3129492');
    $schema = new Schema($this->connection);
    $this->assertInstanceOf(Schema::class$schema);
  }

  /** * @covers Drupal\Core\Database\Driver\mysql\Upsert */
  public function testDeprecationUpsert() {
    $this->expectDeprecation('\Drupal\Core\Database\Driver\mysql\Upsert is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The MySQL database driver has been moved to the mysql module. See https://www.drupal.org/node/3129492');
    $upsert = new Upsert($this->connection, 'test');
    $this->assertInstanceOf(Upsert::class$upsert);
  }

}
Home | Imprint | This part of the site doesn't use cookies.