function DependencyTest::testOffsetGetException

@covers ::offsetGet @group legacy

File

core/tests/Drupal/Tests/Core/Extension/DependencyTest.php, line 78

Class

DependencyTest
@coversDefaultClass \Drupal\Core\Extension\Dependency @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testOffsetGetException() {
    $dependency = new Dependency('views', 'drupal', '>8.x-1.1');
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('The does_not_exist key is not supported');
    $dependency['does_not_exist'];
}

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