You are here

public function RoutingTransactionNameSubscriberTest::testNodeAddRouteTransactionName 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::testNodeAddRouteTransactionName()
  2. 2.0.x tests/src/Unit/EventListener/RoutingTransactionNameSubscriberTest.php \Drupal\Tests\new_relic_rpm\Unit\EventListener\RoutingTransactionNameSubscriberTest::testNodeAddRouteTransactionName()

@covers ::nodeAddTransactionName

File

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

Class

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

Namespace

Drupal\Tests\new_relic_rpm\Unit\EventListener

Code

public function testNodeAddRouteTransactionName() {
  $node_type = $this
    ->prophesize(NodeTypeInterface::class);
  $node_type
    ->id()
    ->willReturn('bar');
  $attributes = [
    '_transaction_name' => 'node.add',
    'node_type' => $node_type
      ->reveal(),
  ];
  $request = new Request([], [], $attributes);
  $actualName = RoutingTransactionNameSubscriber::nodeAddTransactionName($request);
  $this
    ->assertEquals('node.add:bar', $actualName);
}