function InstallerRedirectTraitTest::providerShouldRedirectToInstaller

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php \Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::providerShouldRedirectToInstaller()
  2. 10 core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php \Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::providerShouldRedirectToInstaller()
  3. 11.x core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php \Drupal\KernelTests\Core\Installer\InstallerRedirectTraitTest::providerShouldRedirectToInstaller()

Data provider for testShouldRedirectToInstaller().

Return value

array

  • Expected result from shouldRedirectToInstaller().
  • Exceptions to be handled by shouldRedirectToInstaller()
  • Whether or not there is a database connection.
  • Whether or not there is database connection info.
  • Whether or not there exists a sessions table in the database.

File

core/tests/Drupal/KernelTests/Core/Installer/InstallerRedirectTraitTest.php, line 31

Class

InstallerRedirectTraitTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Installer%21InstallerRedirectTrait.php/trait/InstallerRedirectTrait/8.9.x" title="Provides methods for checking if Drupal is already installed." class="local">\Drupal\Core\Installer\InstallerRedirectTrait</a>

Namespace

Drupal\KernelTests\Core\Installer

Code

public function providerShouldRedirectToInstaller() {
    return [
        [
            TRUE,
            DatabaseNotFoundException::class,
            FALSE,
            FALSE,
        ],
        [
            TRUE,
            DatabaseNotFoundException::class,
            TRUE,
            FALSE,
        ],
        [
            TRUE,
            DatabaseNotFoundException::class,
            FALSE,
            TRUE,
        ],
        [
            TRUE,
            DatabaseNotFoundException::class,
            TRUE,
            TRUE,
        ],
        [
            TRUE,
            DatabaseNotFoundException::class,
            TRUE,
            TRUE,
            FALSE,
        ],
        [
            TRUE,
            \PDOException::class,
            FALSE,
            FALSE,
        ],
        [
            TRUE,
            \PDOException::class,
            TRUE,
            FALSE,
        ],
        [
            FALSE,
            \PDOException::class,
            FALSE,
            TRUE,
        ],
        [
            FALSE,
            \PDOException::class,
            TRUE,
            TRUE,
        ],
        [
            TRUE,
            \PDOException::class,
            TRUE,
            TRUE,
            FALSE,
        ],
        [
            TRUE,
            DatabaseExceptionWrapper::class,
            FALSE,
            FALSE,
        ],
        [
            TRUE,
            DatabaseExceptionWrapper::class,
            TRUE,
            FALSE,
        ],
        [
            FALSE,
            DatabaseExceptionWrapper::class,
            FALSE,
            TRUE,
        ],
        [
            FALSE,
            DatabaseExceptionWrapper::class,
            TRUE,
            TRUE,
        ],
        [
            TRUE,
            DatabaseExceptionWrapper::class,
            TRUE,
            TRUE,
            FALSE,
        ],
        [
            TRUE,
            NotFoundHttpException::class,
            FALSE,
            FALSE,
        ],
        [
            TRUE,
            NotFoundHttpException::class,
            TRUE,
            FALSE,
        ],
        [
            FALSE,
            NotFoundHttpException::class,
            FALSE,
            TRUE,
        ],
        [
            FALSE,
            NotFoundHttpException::class,
            TRUE,
            TRUE,
        ],
        [
            TRUE,
            NotFoundHttpException::class,
            TRUE,
            TRUE,
            FALSE,
        ],
        [
            FALSE,
            \Exception::class,
            FALSE,
            FALSE,
        ],
        [
            FALSE,
            \Exception::class,
            TRUE,
            FALSE,
        ],
        [
            FALSE,
            \Exception::class,
            FALSE,
            TRUE,
        ],
        [
            FALSE,
            \Exception::class,
            TRUE,
            TRUE,
        ],
        [
            FALSE,
            \Exception::class,
            TRUE,
            TRUE,
            FALSE,
        ],
    ];
}

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