function InstallTasksTest::createTasksNoConnection

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

Creates a Tasks object for testing, without connection.

Return value

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

1 call to InstallTasksTest::createTasksNoConnection()
InstallTasksTest::testNameWithNoConnection in core/modules/mysql/tests/src/Unit/InstallTasksTest.php
@covers ::name

File

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

Class

InstallTasksTest
Tests the MySQL install tasks.

Namespace

Drupal\Tests\mysql\Unit

Code

private function createTasksNoConnection() : Tasks {
    return new class  extends Tasks {
        protected function isConnectionActive() {
            return FALSE;
        }
        protected function getConnection() {
            return NULL;
        }
        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.