function UnsupportedRouteAttributePropertiesTest::testException

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Routing/UnsupportedRouteAttributePropertiesTest.php \Drupal\Tests\Core\Routing\UnsupportedRouteAttributePropertiesTest::testException()

@legacy-covers ::createRouteCollection

Attributes

#[DataProvider('providerTestException')]

File

core/tests/Drupal/Tests/Core/Routing/UnsupportedRouteAttributePropertiesTest.php, line 25

Class

UnsupportedRouteAttributePropertiesTest
Tests \Drupal\Core\Routing\AttributeRouteDiscovery.

Namespace

Drupal\Tests\Core\Routing

Code

public function testException(string $class, string $message) : void {
  $discovery = new AttributeRouteDiscovery(new \ArrayIterator());
  $reflection = new \ReflectionClass($discovery);
  $method = $reflection->getMethod('createRouteCollection');
  $this->expectException(UnsupportedRouteAttributePropertyException::class);
  $this->expectExceptionMessage($message);
  $method->invoke($discovery, $class);
}

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