diff --git a/core/modules/path/src/Tests/PathNoCanonicalLinkKernelTest.php b/core/modules/path/src/Tests/PathNoCanonicalLinkKernelTest.php index b5aa83d..8d60c77 100644 --- a/core/modules/path/src/Tests/PathNoCanonicalLinkKernelTest.php +++ b/core/modules/path/src/Tests/PathNoCanonicalLinkKernelTest.php @@ -42,11 +42,17 @@ public function testNoCanonicalLinkTemplate() { $entity_type->addTranslation('de', ['name' => 'name italian']); $entity_type->save(); - $this->assertEqual(count($entity_type->getTranslationLanguages()), 2); + $this->assertEqual(count($entity_type->getTranslationLanguages()), 2, 'Entity is available in two language.'); $entity_type->removeTranslation('de'); - $entity_type->save(); - $this->assertEqual(count($entity_type->getTranslationLanguages()), 1); + try{ + $entity_type->save(); + $this->assertTrue(FALSE, 'There was no exception about a missing link template.'); + } + catch (\Exception $e) { + $this->assertEqual($e->getMessage(), 'No link template \'canonical\' found for the \'entity_test_translatable_UI_skip\' entity type', 'Caught "link template \'canonical\' missing" exception.'); + } + $this->assertEqual(count($entity_type->getTranslationLanguages()), 1, 'Entity is available in one language.'); } }