You are here

private function MigrateUrlAliasTest::assertPath in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php \Drupal\Tests\path\Kernel\Migrate\d6\MigrateUrlAliasTest::assertPath()
  2. 9 core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php \Drupal\Tests\path\Kernel\Migrate\d6\MigrateUrlAliasTest::assertPath()

Asserts that a path alias matches a set of conditions.

@internal

Parameters

int $pid: The path alias ID.

array $conditions: The path conditions.

\Drupal\path_alias\PathAliasInterface $path_alias: The path alias.

1 call to MigrateUrlAliasTest::assertPath()
MigrateUrlAliasTest::testUrlAlias in core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php
Tests the url alias migration.

File

core/modules/path/tests/src/Kernel/Migrate/d6/MigrateUrlAliasTest.php, line 64

Class

MigrateUrlAliasTest
URL alias migration.

Namespace

Drupal\Tests\path\Kernel\Migrate\d6

Code

private function assertPath(int $pid, array $conditions, PathAliasInterface $path_alias) : void {
  $this
    ->assertSame($pid, (int) $path_alias
    ->id());
  $this
    ->assertSame($conditions['alias'], $path_alias
    ->getAlias());
  $this
    ->assertSame($conditions['langcode'], $path_alias
    ->get('langcode')->value);
  $this
    ->assertSame($conditions['path'], $path_alias
    ->getPath());
}