21
21
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyCar ;
22
22
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyCarColor ;
23
23
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyFriend ;
24
+ use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyGroup ;
24
25
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyOffer ;
25
26
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \DummyProduct ;
26
27
use ApiPlatform \Core \Tests \Fixtures \TestBundle \Entity \FileConfigDummy ;
35
36
use Behat \Behat \Context \SnippetAcceptingContext ;
36
37
use Behatch \HttpCall \Request ;
37
38
use Doctrine \Common \Persistence \ManagerRegistry ;
39
+ use Doctrine \Common \Persistence \ObjectManager ;
38
40
use Doctrine \ORM \Tools \SchemaTool ;
39
41
40
42
/**
@@ -45,7 +47,7 @@ class FeatureContext implements Context, SnippetAcceptingContext
45
47
private $ doctrine ;
46
48
47
49
/**
48
- * @var \Doctrine\Common\Persistence\ ObjectManager
50
+ * @var ObjectManager
49
51
*/
50
52
private $ manager ;
51
53
@@ -127,6 +129,24 @@ public function thereIsDummyObjects($nb)
127
129
$ this ->manager ->flush ();
128
130
}
129
131
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
+
130
150
/**
131
151
* @Given there is :nb dummy objects with relatedDummy
132
152
*/
0 commit comments