Issue #3409895: [regression] toUrl can incorrectly return edit-form url when another link template shares the canonical url
1 unresolved thread
Closes #3409895
Merge request reports
Activity
111 * Tests the toUrl() method without specifying the $rel parameter. 112 * 113 * toUrl should throw an exception when neither canonical or edit-form rels 114 * exist. 112 115 * 113 116 * @covers ::toUrl 114 117 */ 115 public function testToUrlDefault() { 118 public function testToUrlDefaultException(): void { 116 119 $values = ['id' => $this->entityId]; 117 120 $entity = $this->getEntity(UrlTestEntity::class, $values); 118 121 119 122 $this->expectException(UndefinedLinkTemplateException::class); 120 123 $this->expectExceptionMessage("Cannot generate default URL because no link template 'canonical' or 'edit-form' was found for the '" . $this->entityTypeId . "' entity type"); 121 124 $entity->toUrl(); 125 } Note: This test is bugged on HEAD. Asserting an exception needs to be in its own test case. Running the test as it is currently does not execute the assertions after this line.
Edited by Adam Bramley
- Resolved by Adam Bramley
Please register or sign in to reply