TestSetupTraitTest.php

Same filename in this branch
  1. 11.x core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
Same filename and directory in other branches
  1. 9 core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
  2. 8.9.x core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
  3. 10 core/tests/Drupal/KernelTests/Core/Test/TestSetupTraitTest.php
  4. 10 core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php

Namespace

Drupal\KernelTests\Core\Test

File

core/tests/Drupal/KernelTests/Core/Test/TestSetupTraitTest.php

View source
<?php

namespace Drupal\KernelTests\Core\Test;

use Drupal\Core\Test\TestSetupTrait;
use Drupal\KernelTests\KernelTestBase;

/**
 * Tests the TestSetupTrait trait.
 *
 * @coversDefaultClass \Drupal\Core\Test\TestSetupTrait
 * @group Testing
 *
 * Run in a separate process as this test involves Database statics and
 * environment variables.
 * @runTestsInSeparateProcesses
 * @preserveGlobalState disabled
 */
class TestSetupTraitTest extends KernelTestBase {
    use TestSetupTrait;
    
    /**
     * @covers ::getDatabaseConnection
     * @group legacy
     */
    public function testGetDatabaseConnection() : void {
        $this->expectDeprecation('Drupal\\Core\\Test\\TestSetupTrait::getDatabaseConnection is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3176816');
        $this->assertNotNull($this->getDatabaseConnection());
    }

}

Classes

Title Deprecated Summary
TestSetupTraitTest Tests the TestSetupTrait trait.

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