function MigrateUrlAliasTest::assertPath

Same name in other branches
  1. 9 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()
  3. 11.x 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
Test 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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.