Skip to content

Commit 3d71742

Browse files
committed
Add a filter for serialization groups
1 parent 183b0a5 commit 3d71742

File tree

11 files changed

+1352
-1
lines changed

11 files changed

+1352
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCar;
2222
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyCarColor;
2323
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyFriend;
24+
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyGroup;
2425
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyOffer;
2526
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyProduct;
2627
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\FileConfigDummy;
@@ -35,6 +36,7 @@
3536
use Behat\Behat\Context\SnippetAcceptingContext;
3637
use Behatch\HttpCall\Request;
3738
use Doctrine\Common\Persistence\ManagerRegistry;
39+
use Doctrine\Common\Persistence\ObjectManager;
3840
use Doctrine\ORM\Tools\SchemaTool;
3941

4042
/**
@@ -45,7 +47,7 @@ class FeatureContext implements Context, SnippetAcceptingContext
4547
private $doctrine;
4648

4749
/**
48-
* @var \Doctrine\Common\Persistence\ObjectManager
50+
* @var ObjectManager
4951
*/
5052
private $manager;
5153

@@ -127,6 +129,24 @@ public function thereIsDummyObjects($nb)
127129
$this->manager->flush();
128130
}
129131

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

0 commit comments

Comments
 (0)