You are here

private function TasksTest::createTasks in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php \Drupal\Tests\Core\Database\Driver\mysql\install\TasksTest::createTasks()

Creates a Tasks object for testing.

Return value

\Drupal\mysql\Driver\Database\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\mysql\Driver\Database\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;
    }

  };
}