You are here

private function MigrateUrlAliasTest::assertPath in Drupal 9

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. 10 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.

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 62

Class

MigrateUrlAliasTest
URL alias migration.

Namespace

Drupal\Tests\path\Kernel\Migrate\d6

Code

private function assertPath($pid, $conditions, PathAliasInterface $path_alias) {
  $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());
}