Skip to content

Commit

Permalink
Merge pull request #22 from sandstorm/update/neos-8.3
Browse files Browse the repository at this point in the history
make FusionServiceForTesting compatible to Neos 8.3
  • Loading branch information
erickloss authored Jun 6, 2023
2 parents 57d8d14 + f9611e3 commit bddd0d9
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Classes/FusionServiceForTesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Sandstorm\E2ETestTools;

use Neos\Flow\Annotations as Flow;
use Neos\Fusion\Core\FusionSourceCodeCollection;
use Neos\Neos\Domain\Service\FusionService;
use Sandstorm\E2ETestTools\Tests\Behavior\Bootstrap\FusionRenderingTrait;

Expand All @@ -21,17 +22,18 @@ class FusionServiceForTesting extends FusionService
public function getMergedFusionObjectTreeForPackage(string $siteResourcesPackageKey, string $extraFusionCode)
{
$siteRootFusionPathAndFilename = sprintf($this->siteRootFusionPattern, $siteResourcesPackageKey);
$siteRootFusionCode = $this->readExternalFusionFile($siteRootFusionPathAndFilename);

$mergedFusionCode = '';
$mergedFusionCode .= $this->generateNodeTypeDefinitions();
$mergedFusionCode .= $this->getFusionIncludes($this->prepareAutoIncludeFusion());
$mergedFusionCode .= $this->getFusionIncludes($this->prependFusionIncludes);
$mergedFusionCode .= $siteRootFusionCode;
$mergedFusionCode .= $this->getFusionIncludes($this->appendFusionIncludes);

$mergedFusionCode .= $extraFusionCode;

return $this->fusionParser->parse($mergedFusionCode, $siteRootFusionPathAndFilename);
return $this->fusionParser->parseFromSource(
$this->fusionSourceCodeFactory->createFromNodeTypeDefinitions()
->union(
$this->fusionSourceCodeFactory->createFromAutoIncludes()
)
->union(
FusionSourceCodeCollection::tryFromFilePath($siteRootFusionPathAndFilename)
)
->union(
FusionSourceCodeCollection::fromString($extraFusionCode)
)
);
}
}

0 comments on commit bddd0d9

Please sign in to comment.