You are here

public function PathautoTestHelperTrait::assertEntityAlias in Pathauto 8

20 calls to PathautoTestHelperTrait::assertEntityAlias()
PathautoEntityWithStringIdTest::testEntityWithStringId in tests/src/Kernel/PathautoEntityWithStringIdTest.php
Test aliasing entities with long string ID.
PathautoKernelTest::testCreateNodeWhileAccessingPath in tests/src/Kernel/PathautoKernelTest.php
Tests that the pathauto state property gets set to CREATED for new nodes.
PathautoKernelTest::testDefaultRevision in tests/src/Kernel/PathautoKernelTest.php
Tests that aliases are only generated for default revisions.
PathautoKernelTest::testNoExistingPathAliases in tests/src/Kernel/PathautoKernelTest.php
PathautoKernelTest::testNoTokensNoAlias in tests/src/Kernel/PathautoKernelTest.php
Test that \Drupal::service('pathauto.generator')->createEntityAlias() will not create an alias for a pattern that does not get any tokens replaced.

... See full list

File

tests/src/Functional/PathautoTestHelperTrait.php, line 90

Class

PathautoTestHelperTrait
Helper test class with some added functions for testing.

Namespace

Drupal\Tests\pathauto\Functional

Code

public function assertEntityAlias(EntityInterface $entity, $expected_alias, $langcode = NULL) {

  // By default, use the entity language.
  if (!$langcode) {
    $langcode = $entity
      ->language()
      ->getId();
  }
  $this
    ->assertAlias('/' . $entity
    ->toUrl()
    ->getInternalPath(), $expected_alias, $langcode);
}