From 316e00b39a68210764c94daf338c999fa717297f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20G=C3=BCnther?= Date: Tue, 15 Feb 2022 14:10:48 +0100 Subject: [PATCH] BUGFIX: Fix disablingSetNoOpenerWorks test for convertUri Fixes the disablingSetNoOpenerWorks test for the convertUri. Now the test respects the value of setNoOpener. fixes: #3605 --- .../Fusion/ConvertUrisImplementationTest.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Neos.Neos/Tests/Unit/Fusion/ConvertUrisImplementationTest.php b/Neos.Neos/Tests/Unit/Fusion/ConvertUrisImplementationTest.php index 856e28fc0d4..335650f12c4 100644 --- a/Neos.Neos/Tests/Unit/Fusion/ConvertUrisImplementationTest.php +++ b/Neos.Neos/Tests/Unit/Fusion/ConvertUrisImplementationTest.php @@ -326,9 +326,24 @@ public function evaluateReplaceResourceLinkTargets() */ public function disablingSetNoOpenerWorks() { - $value = 'This string contains an external link: example3'; - $this->addValueExpectation($value, null, false, '_blank', null, false, false); - $expectedResult = 'This string contains an external link: example3'; + $nodeIdentifier = 'aeabe76a-551a-495f-a324-ad9a86b2aff7'; + $externalLinkTarget = '_blank'; + + $value = 'This string contains a link to a node: node and one to an external url with a target set example and one without a target example2'; + $this->addValueExpectation($value, null, false, $externalLinkTarget, null, false, false); + + $this->mockWorkspace->expects(self::any())->method('getName')->will(self::returnValue('live')); + + $self = $this; + $this->mockLinkingService->expects(self::atLeastOnce())->method('resolveNodeUri')->will(self::returnCallback(function ($nodeUri) use ($self, $nodeIdentifier) { + if ($nodeUri === 'node://' . $nodeIdentifier) { + return 'http://localhost/uri/01'; + } else { + $self->fail('Unexpected node URI "' . $nodeUri . '"'); + } + })); + + $expectedResult = 'This string contains a link to a node: node and one to an external url with a target set example and one without a target example2'; $actualResult = $this->convertUrisImplementation->evaluate(); self::assertSame($expectedResult, $actualResult); }