You are here

private function TasksTest::createTasks in Drupal 9

Creates a Tasks object for testing.

Return value

\Drupal\Core\Database\Driver\mysql\Install\Tasks

1 call to TasksTest::createTasks()
TasksTest::testNameAndMinimumVersion in core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php
@covers ::minimumVersion @covers ::name @dataProvider providerNameAndMinimumVersion

File

core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php, line 36

Class

TasksTest
Tests the MySQL install tasks.

Namespace

Drupal\Tests\Core\Database\Driver\mysql\install

Code

private function createTasks() : Tasks {

  /** @var \Drupal\Core\Database\Driver\mysql\Connection $connection */
  $connection = $this->connection
    ->reveal();
  return new class($connection) extends Tasks {
    private $connection;
    public function __construct(Connection $connection) {
      $this->connection = $connection;
    }
    protected function isConnectionActive() {
      return TRUE;
    }
    protected function getConnection() {
      return $this->connection;
    }
    protected function t($string, array $args = [], array $options = []) {
      return $string;
    }

  };
}