You are here

public function RoutingTransactionNameSubscriberTest::testEntityRouteTransactionName in New Relic 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/EventListener/RoutingTransactionNameSubscriberTest.php \Drupal\Tests\new_relic_rpm\Unit\EventListener\RoutingTransactionNameSubscriberTest::testEntityRouteTransactionName()
  2. 2.0.x tests/src/Unit/EventListener/RoutingTransactionNameSubscriberTest.php \Drupal\Tests\new_relic_rpm\Unit\EventListener\RoutingTransactionNameSubscriberTest::testEntityRouteTransactionName()

@covers ::entityBundleRouteTransactionName

File

tests/src/Unit/EventListener/RoutingTransactionNameSubscriberTest.php, line 53

Class

RoutingTransactionNameSubscriberTest
@coversDefaultClass \Drupal\new_relic_rpm\EventSubscriber\RoutingTransactionNameSubscriber @group new_relic_rpm

Namespace

Drupal\Tests\new_relic_rpm\Unit\EventListener

Code

public function testEntityRouteTransactionName() {
  $entity = $this
    ->prophesize(EntityInterface::class);
  $entity
    ->bundle()
    ->willReturn('bar');
  $attributes = [
    '_transaction_name' => 'entity.foo.canonical',
    'foo' => $entity
      ->reveal(),
  ];
  $request = new Request([], [], $attributes);
  $actualName = RoutingTransactionNameSubscriber::entityBundleRouteTransactionName($request);
  $this
    ->assertEquals('entity.foo.canonical:bar', $actualName);
}