function PathNoCanonicalLinkTest::testNoCanonicalLinkTemplate
Tests for no canonical link templates.
File
- 
              core/
modules/ path/ tests/ src/ Kernel/ PathNoCanonicalLinkTest.php, line 51  
Class
- PathNoCanonicalLinkTest
 - Tests path alias deletion when there is no canonical link template.
 
Namespace
Drupal\Tests\path\KernelCode
public function testNoCanonicalLinkTemplate() : void {
  $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());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.