Skip to content

Commit ddb72a3

Browse files
committed
Add a filter for serialization attributes
1 parent b2df66a commit ddb72a3

File tree

9 files changed

+663
-4
lines changed

9 files changed

+663
-4
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCarColor;
2222
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyFriend;
2323
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyGroup;
24+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyProperty;
2425
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\FileConfigDummy;
2526
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Node;
2627
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Question;
@@ -143,6 +144,28 @@ public function thereIsDummyGroupObjects($nb)
143144
$this->manager->flush();
144145
}
145146

147+
/**
148+
* @Given there is :nb dummy property objects
149+
*/
150+
public function thereIsDummyPropertyObjects($nb)
151+
{
152+
for ($i = 1; $i <= $nb; ++$i) {
153+
$dummyProperty = new DummyProperty();
154+
$dummyGroup = new DummyGroup();
155+
156+
foreach (['foo', 'bar', 'baz'] as $property) {
157+
$dummyProperty->$property = $dummyGroup->$property = ucfirst($property).' #'.$i;
158+
}
159+
160+
$dummyProperty->group = $dummyGroup;
161+
162+
$this->manager->persist($dummyGroup);
163+
$this->manager->persist($dummyProperty);
164+
}
165+
166+
$this->manager->flush();
167+
}
168+
146169
/**
147170
* @Given there is :nb dummy objects with relatedDummy
148171
*/

0 commit comments

Comments
 (0)