You are here

public function PathProcessorFrontTest::testProcessInbound in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorFrontTest::testProcessInbound()
  2. 9 core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php \Drupal\Tests\Core\PathProcessor\PathProcessorFrontTest::testProcessInbound()

Tests basic inbound processing functionality.

@covers ::processInbound @dataProvider providerProcessInbound

File

core/tests/Drupal/Tests/Core/PathProcessor/PathProcessorFrontTest.php, line 26

Class

PathProcessorFrontTest
Test front page path processing.

Namespace

Drupal\Tests\Core\PathProcessor

Code

public function testProcessInbound($frontpage_path, $path, $expected, array $expected_query = []) {
  $config_factory = $this
    ->prophesize(ConfigFactoryInterface::class);
  $config = $this
    ->prophesize(ImmutableConfig::class);
  $config_factory
    ->get('system.site')
    ->willReturn($config
    ->reveal());
  $config
    ->get('page.front')
    ->willReturn($frontpage_path);
  $processor = new PathProcessorFront($config_factory
    ->reveal());
  $request = new Request();
  $this
    ->assertEquals($expected, $processor
    ->processInbound($path, $request));
  $this
    ->assertEquals($expected_query, $request->query
    ->all());
}