-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from neos/bugfix/78-tweak-primary-content-repl…
…acement TASK: Replace usages of `Neos.Neos:PrimaryContent`
- Loading branch information
Showing
8 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...Generic/Rules/FusionPrototypeNameReplacement/Fixture/skip_prototype_definition.fusion.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
prototype(Neos.Neos:Foo) < prototype(Neos.Neos:Bar) { | ||
|
||
raw = Neos.Neos:Foo | ||
renderer = afx` | ||
<Neos.Neos:Bar /> | ||
` | ||
} | ||
----- | ||
// TODO 9.0 migration: Neos.Neos:FooReplaced: This comment should be added on top of the file. | ||
// TODO 9.0 migration: Neos.Neos:BarReplaced: This comment should be added on top of the file. | ||
prototype(Neos.Neos:Foo) < prototype(Neos.Neos:Bar) { | ||
|
||
raw = Neos.Neos:FooReplaced | ||
renderer = afx` | ||
<Neos.Neos:BarReplaced /> | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/Sets/ContentRepository90/ContentRepository90Test.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\Rector\Tests\Sets\ContentRepository90; | ||
|
||
use Rector\Testing\PHPUnit\AbstractRectorTestCase; | ||
|
||
final class ContentRepository90Test extends AbstractRectorTestCase | ||
{ | ||
/** | ||
* @dataProvider provideData() | ||
*/ | ||
public function test(string $fileInfo): void | ||
{ | ||
$this->doTestFile($fileInfo); | ||
} | ||
|
||
/** | ||
* @return \Iterator<string> | ||
*/ | ||
public function provideData(): \Iterator | ||
{ | ||
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture', '*.fusion.inc'); | ||
} | ||
|
||
public function provideConfigFilePath(): string | ||
{ | ||
return __DIR__ . '/../../../config/set/contentrepository-90.php'; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/Sets/ContentRepository90/Fixture/primary-content.fusion.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
prototype(Neos.Neos:PrimaryContent) { | ||
myArticle { | ||
condition = ${q(node).is('[instanceof My.Site:Article]')} | ||
renderer = My.Site:ArticleRenderer | ||
} | ||
} | ||
|
||
content = Neos.Neos:PrimaryContent { | ||
nodePath = 'main' | ||
} | ||
----- | ||
// TODO 9.0 migration: "Neos.Neos:PrimaryContent" has been removed without a complete replacement. We replaced all usages with "Neos.Neos:ContentCollection" but not the prototype definition. Please check the replacements and if you have overridden the "Neos.Neos:PrimaryContent" prototype and rewrite it for your needs. | ||
prototype(Neos.Neos:PrimaryContent) { | ||
myArticle { | ||
condition = ${q(node).is('[instanceof My.Site:Article]')} | ||
renderer = My.Site:ArticleRenderer | ||
} | ||
} | ||
|
||
content = Neos.Neos:ContentCollection { | ||
nodePath = 'main' | ||
} |