function InstallTasksTest::createTasks

Same name in other branches
  1. 10 core/modules/mysql/tests/src/Unit/InstallTasksTest.php \Drupal\Tests\mysql\Unit\InstallTasksTest::createTasks()
  2. 11.x core/modules/mysql/tests/src/Unit/InstallTasksTest.php \Drupal\Tests\mysql\Unit\InstallTasksTest::createTasks()

Creates a Tasks object for testing.

Return value

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

1 call to InstallTasksTest::createTasks()
InstallTasksTest::testNameAndMinimumVersion in core/modules/mysql/tests/src/Unit/InstallTasksTest.php
@covers ::minimumVersion @covers ::name @dataProvider providerNameAndMinimumVersion

File

core/modules/mysql/tests/src/Unit/InstallTasksTest.php, line 36

Class

InstallTasksTest
Tests the MySQL install tasks.

Namespace

Drupal\Tests\mysql\Unit

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;
        }

};
}

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