function ShareEnvironmentTest::testAttributeOptingOut

Same name and namespace in other branches
  1. main core/tests/Drupal/Tests/TestTools/Attribute/ShareEnvironmentTest.php \Drupal\Tests\TestTools\Attribute\ShareEnvironmentTest::testAttributeOptingOut()

Tests that a class can state that it needs its own environment.

The declaration does nothing while sharing is opt-in, and everything once sharing becomes the default.

File

core/tests/Drupal/Tests/TestTools/Attribute/ShareEnvironmentTest.php, line 45

Class

ShareEnvironmentTest
Tests how the ShareEnvironment attribute is resolved.

Namespace

Drupal\Tests\TestTools\Attribute

Code

public function testAttributeOptingOut() : void {
  $this->assertFalse(ShareEnvironment::isEnabledFor(DedicatedEnvironmentFixture::class));
}

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