Skip to content

Commit f738976

Browse files
committed
Add a filter for serialization attributes
1 parent b24fbc7 commit f738976

File tree

9 files changed

+666
-6
lines changed

9 files changed

+666
-6
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy;
2020
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCar;
2121
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCarColor;
22+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyField;
2223
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyFriend;
2324
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyGroup;
2425
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\FileConfigDummy;
@@ -143,6 +144,28 @@ public function thereIsDummyGroupObjects($nb)
143144
$this->manager->flush();
144145
}
145146

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

0 commit comments

Comments
 (0)