Skip to content

Commit 722165c

Browse files
committed
Add a filter for serialization attributes
1 parent 3d71742 commit 722165c

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
@@ -24,6 +24,7 @@
2424
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyGroup;
2525
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyOffer;
2626
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyProduct;
27+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyProperty;
2728
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\FileConfigDummy;
2829
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Node;
2930
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Question;
@@ -147,6 +148,28 @@ public function thereIsDummyGroupObjects($nb)
147148
$this->manager->flush();
148149
}
149150

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

0 commit comments

Comments
 (0)