Skip to content

Commit 9caf397

Browse files
committed
Add a filter for serialization groups
1 parent ff3f1ba commit 9caf397

File tree

12 files changed

+1340
-8
lines changed

12 files changed

+1340
-8
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCar;
2121
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCarColor;
2222
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyFriend;
23+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyGroup;
2324
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\FileConfigDummy;
2425
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Node;
2526
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Question;
@@ -124,6 +125,24 @@ public function thereIsDummyObjects($nb)
124125
$this->manager->flush();
125126
}
126127

128+
/**
129+
* @Given there is :nb dummy group objects
130+
*/
131+
public function thereIsDummyGroupObjects($nb)
132+
{
133+
for ($i = 1; $i <= $nb; ++$i) {
134+
$dummyGroup = new DummyGroup();
135+
136+
foreach (['foo', 'bar', 'baz', 'qux'] as $property) {
137+
$dummyGroup->$property = ucfirst($property).' #'.$i;
138+
}
139+
140+
$this->manager->persist($dummyGroup);
141+
}
142+
143+
$this->manager->flush();
144+
}
145+
127146
/**
128147
* @Given there is :nb dummy objects with relatedDummy
129148
*/

0 commit comments

Comments
 (0)