public function PathNoCanonicalLinkTest::testNoCanonicalLinkTemplate in Drupal 8
Same name and namespace in other branches
- 9 core/modules/path/tests/src/Kernel/PathNoCanonicalLinkTest.php \Drupal\Tests\path\Kernel\PathNoCanonicalLinkTest::testNoCanonicalLinkTemplate()
Tests for no canonical link templates.
File
- core/
modules/ path/ tests/ src/ Kernel/ PathNoCanonicalLinkTest.php, line 49
Class
- PathNoCanonicalLinkTest
- Tests path alias deletion when there is no canonical link template.
Namespace
Drupal\Tests\path\KernelCode
public function testNoCanonicalLinkTemplate() {
$entity_type = EntityTestTranslatableUISkip::create([
'name' => 'name english',
'language' => 'en',
]);
$entity_type
->save();
$entity_type
->addTranslation('de', [
'name' => 'name german',
]);
$entity_type
->save();
$this
->assertCount(2, $entity_type
->getTranslationLanguages());
$entity_type
->removeTranslation('de');
$entity_type
->save();
$this
->assertCount(1, $entity_type
->getTranslationLanguages());
}