Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: Fusion Behat Test Make Sure To Throw Runtime Exceptions #4743

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion Neos.Neos/Tests/Behavior/Features/Bootstrap/FusionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ public function iExecuteTheFollowingFusionCode(PyStringNode $fusionCode, string
self::$bootstrap->setActiveRequestHandler($requestHandler);
$this->throwExceptionIfLastRenderingLedToAnError();
$this->renderingResult = null;
$fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($this->fusionCode . chr(10) . $fusionCode->getRaw()));
$fusionAst = (new Parser())->parseFromSource(FusionSourceCodeCollection::fromString($this->fusionCode . chr(10) . $fusionCode->getRaw())->union(
// make sure all exceptions are thrown. Not needed with Neos 9
FusionSourceCodeCollection::fromString(<<<FUSION
$path {
@exceptionHandler = 'Neos\\\\Fusion\\\\Core\\\\ExceptionHandlers\\\\ThrowingHandler'
}
FUSION)
));
$uriBuilder = new UriBuilder();
$uriBuilder->setRequest($this->fusionRequest);
$controllerContext = new ControllerContext($this->fusionRequest, new ActionResponse(), new Arguments(), $uriBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ 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 {
@exceptionHandler = 'Neos\\Fusion\\Core\\ExceptionHandlers\\ThrowingHandler'
}
test = Neos.Neos:ContentCollection
"""
Then I expect the following Fusion rendering error:
"""
Expand All @@ -50,7 +48,6 @@ 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