Skip to content

Commit

Permalink
Fix todo from ecamp#2571 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Jul 5, 2022
1 parent 26886d8 commit b71b6a6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion api/tests/Api/ContentNodes/ContentNode/ReadContentNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Tests\Api\ContentNodes\ContentNode;

use App\Entity\ContentNode;
use App\Entity\ContentNode\Storyboard;
use App\Tests\Api\ECampApiTestCase;

/**
Expand All @@ -24,7 +25,17 @@ public function testGetSingleContentNodeIsAllowedForCollaborator() {
'contentTypeName' => $contentNode->getContentTypeName(),
'_links' => [
'parent' => ['href' => $this->getIriFor($contentNode->parent)],
'children' => [],
// For performance reasons, children must be an array of hrefs, not a single href to a collection!
// If this test breaks here, that means you probably added a "parent" filter on ContentNode.
// If you really need that filter, see https://github.com/ecamp/ecamp3/pull/2571#discussion_r844089434
// for more info on why it was previously removed. You will then probably have to adapt
// RelatedCollectionLinkNormalizer and add a way to explicitly disable related collection links on a
// specific relation, so that the "parent" filter can co-exist with children being an array.
'children' => [
['href' => $this->getIriFor('multiSelect2')],
['href' => $this->getIriFor('singleText2')],
['href' => $this->getIriFor('storyboard2')],
],
'self' => ['href' => $this->getIriFor('columnLayoutChild1')],
],
]);
Expand Down

0 comments on commit b71b6a6

Please sign in to comment.