-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Introduce NodeWithContentStreamId for testing
We cannot rely on $this->currentContentStreamId being the matching one for $this->currentNode, because the step `I expect a node identified by live-cs-identifier;lady-eleonode-nodesworth;{} to exist in the content graph` can initialize a foreign node!
- Loading branch information
Showing
5 changed files
with
90 additions
and
45 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
29 changes: 29 additions & 0 deletions
29
...ository.TestSuite/Classes/Behavior/Features/Bootstrap/Helpers/NodeWithContentStreamId.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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Helpers; | ||
|
||
use Neos\ContentRepository\Core\Projection\ContentGraph\Node; | ||
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; | ||
use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; | ||
|
||
final readonly class NodeWithContentStreamId | ||
{ | ||
private function __construct( | ||
public NodeAggregateId $aggregateId, | ||
public Node $instance, | ||
public ContentStreamId $contentStreamId, | ||
) { | ||
} | ||
|
||
public static function create(Node $node, ContentStreamId $contentStreamId): self | ||
{ | ||
return new self($node->aggregateId, $node, $contentStreamId); | ||
} | ||
|
||
public function withNode(Node $node): self | ||
{ | ||
return new self($node->aggregateId, $node, $this->contentStreamId); | ||
} | ||
} |
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