You are here

public function DependencyTest::testOffsetGetException in Drupal 8

@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'];
}