Skip to content

Commit bed07ec

Browse files
committed
WIP
1 parent 7db786e commit bed07ec

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

features/bootstrap/DoctrineContext.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ public function thereIsAPage(string $reference = 'page'): Page
401401
$page = new Page();
402402
$page->isTemplate = false;
403403
$page->reference = $reference;
404+
$page->layout = $this->thereIsALayout();
404405
$this->timestampedHelper->persistTimestampedFields($page, true);
405406
$this->manager->persist($page);
406407
$this->manager->flush();
@@ -495,7 +496,7 @@ public function thereIsARouteWithRedirects(string $firstPath, string $redirectTo
495496
/**
496497
* @Given /^there is a Layout(?: with the reference "([^"]+)")*[ and]*(?: with createdAt "([^"]+)")*(?: with the uiComponent "([^"]+)")*$/
497498
*/
498-
public function thereIsALayout(string $reference = 'no-reference', ?string $createdAt = null, ?string $uiComponent = null): void
499+
public function thereIsALayout(string $reference = 'no-reference', ?string $createdAt = null, ?string $uiComponent = null): Layout
499500
{
500501
$layout = new Layout();
501502
$layout->reference = $reference;
@@ -507,6 +508,7 @@ public function thereIsALayout(string $reference = 'no-reference', ?string $crea
507508
$this->manager->persist($layout);
508509
$this->manager->flush();
509510
$this->restContext->resources['layout'] = $this->iriConverter->getIriFromResource($layout);
511+
return $layout;
510512
}
511513

512514
/**

features/main/page.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,10 @@ Feature: Page resources
5757
Given there is a Page
5858
When I send a "DELETE" request to the resource "page"
5959
Then the response status code should be 204
60+
61+
@loginUser
62+
Scenario: The page resources can be filtered by title
63+
Given there is a Page
64+
When I send a "GET" request to "/_/pages"
65+
Then the response status code should be 200
66+
And the JSON node "hydra:member" should have "1" elements

0 commit comments

Comments
 (0)