Skip to content

Commit c061263

Browse files
committed
target dummy entity fix
1 parent 9f47142 commit c061263

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,15 +1010,31 @@ public function thereIsADummyObjectWithAFourthLevelRelation()
10101010
}
10111011

10121012
/**
1013-
* @Given there is a RelatedOwnedDummy and a RelatedOwningDummy object with OneToOne bidirectional relation
1013+
* @Given there is a RelatedOwnedDummy object with OneToOne relation
10141014
*/
1015-
public function thereIsARelatedOwnedDummyAndARelatedOwningDummy()
1015+
public function thereIsARelatedOwnedDummy()
10161016
{
10171017
$relatedOwnedDummy = new RelatedOwnedDummy();
10181018
$this->manager->persist($relatedOwnedDummy);
10191019

1020+
$dummy = new Dummy();
1021+
$dummy->setOwnedDummy($relatedOwnedDummy);
1022+
$this->manager->persist($dummy);
1023+
1024+
$this->manager->flush();
1025+
}
1026+
1027+
/**
1028+
* @Given there is a RelatedOwningDummy object with OneToOne relation
1029+
*/
1030+
public function thereIsARelatedOwningDummy()
1031+
{
1032+
1033+
$dummy = new Dummy();
1034+
$this->manager->persist($dummy);
1035+
10201036
$relatedOwningDummy = new RelatedOwningDummy();
1021-
$relatedOwningDummy->setOwnedDummy($relatedOwnedDummy);
1037+
$relatedOwningDummy->setOwnedDummy($dummy);
10221038
$this->manager->persist($relatedOwningDummy);
10231039

10241040
$this->manager->flush();

features/main/subresource.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -368,34 +368,34 @@ Feature: Subresource support
368368

369369
@dropSchema
370370
Scenario: The OneToOne subresource should be accessible from owned side
371-
Given there is a RelatedOwnedDummy and a RelatedOwningDummy object with OneToOne bidirectional relation
372-
When I send a "GET" request to "/related_owned_dummies/1/related_owning_dummy"
371+
@Given there is a RelatedOwnedDummy object with OneToOne relation
372+
When I send a "GET" request to "/related_owned_dummies/1/owning_dummy"
373373
And the response status code should be 200
374374
And the response should be in JSON
375375
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
376376
And the JSON should be equal to:
377377
"""
378378
{
379-
"@context": "/contexts/RelatedOwningDummy",
380-
"@id": "/related_owning_dummies/1",
381-
"@type": "RelatedOwningDummy",
379+
"@context": "/contexts/Dummy",
380+
"@id": "/dummies/1",
381+
"@type": "Dummy",
382382
"id": 1
383383
}
384384
"""
385385

386386
@dropSchema
387387
Scenario: The OneToOne subresource should be accessible from owning side
388-
Given there is a RelatedOwnedDummy and a RelatedOwningDummy object with OneToOne bidirectional relation
389-
When I send a "GET" request to "/related_owning_dummies/1/related_owned_dummy"
388+
Given there is a RelatedOwningDummy object with OneToOne relation
389+
When I send a "GET" request to "/related_owning_dummies/1/owned_dummy"
390390
And the response status code should be 200
391391
And the response should be in JSON
392392
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
393393
And the JSON should be equal to:
394394
"""
395395
{
396-
"@context": "/contexts/RelatedOwnedDummy",
397-
"@id": "/related_owned_dummies/1",
398-
"@type": "RelatedOwnedDummy",
396+
"@context": "/contexts/Dummy",
397+
"@id": "/dummies/1",
398+
"@type": "Dummy",
399399
"id": 1
400400
}
401401
"""

0 commit comments

Comments
 (0)