function ShareEnvironmentTest::testAttributeIsNotInherited

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

Tests that the attribute is not inherited.

Every test class declares for itself. A class that inherited the attribute would start sharing an environment nobody audited it for.

File

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

Class

ShareEnvironmentTest
Tests how the ShareEnvironment attribute is resolved.

Namespace

Drupal\Tests\TestTools\Attribute

Code

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

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