Skip to content

Commit

Permalink
Merge pull request #4686 from neos/task/fixContentCollectionFeature
Browse files Browse the repository at this point in the history
TASK: 2nd fixup for PR #4641 ContentCollection.feature
  • Loading branch information
kdambekalns authored Nov 2, 2023
2 parents 478064b + 9515cbd commit a0d8ca0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Neos\Fusion\Core\FusionSourceCodeCollection;
use Neos\Fusion\Core\Parser;
use Neos\Fusion\Core\RuntimeFactory;
use Neos\Fusion\Exception\RuntimeException;
use Neos\Neos\Domain\Service\ContentContext;
use Neos\Neos\Routing\RequestUriHostMiddleware;
use PHPUnit\Framework\Assert;
Expand Down Expand Up @@ -131,7 +132,11 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string
try {
$this->renderingResult = $fusionRuntime->render($path);
} catch (\Throwable $exception) {
$this->lastRenderingException = $exception;
if ($exception instanceof RuntimeException) {
$this->lastRenderingException = $exception->getPrevious();
} else {
$this->lastRenderingException = $exception;
}
}
$fusionRuntime->popContext();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype
include: resource://Neos.Fusion/Private/Fusion/Root.fusion
include: resource://Neos.Neos/Private/Fusion/Root.fusion
test = Neos.Neos:ContentCollection
test = Neos.Neos:ContentCollection {
@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler'
}
"""
Then I expect the following Fusion rendering error:
"""
Expand All @@ -48,6 +50,7 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype
test = Neos.Neos:ContentCollection {
nodePath = 'invalid'
@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler'
}
"""
Then I expect the following Fusion rendering error:
Expand Down

0 comments on commit a0d8ca0

Please sign in to comment.