You are here

public function AjaxBasePageNegotiatorTest::testApplies in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php \Drupal\Tests\Core\Theme\AjaxBasePageNegotiatorTest::testApplies()

@covers ::applies @dataProvider providerTestApplies

File

core/tests/Drupal/Tests/Core/Theme/AjaxBasePageNegotiatorTest.php, line 56

Class

AjaxBasePageNegotiatorTest
@coversDefaultClass \Drupal\Core\Theme\AjaxBasePageNegotiator @group Theme

Namespace

Drupal\Tests\Core\Theme

Code

public function testApplies($request_data, $expected) {
  $request = new Request([], $request_data);
  $route_match = RouteMatch::createFromRequest($request);
  $this->requestStack
    ->push($request);
  $result = $this->negotiator
    ->applies($route_match);
  $this
    ->assertSame($expected, $result);
}