58
58
use ApiPlatform \Tests \Fixtures \TestBundle \Document \FileConfigDummy as FileConfigDummyDocument ;
59
59
use ApiPlatform \Tests \Fixtures \TestBundle \Document \Foo as FooDocument ;
60
60
use ApiPlatform \Tests \Fixtures \TestBundle \Document \FooDummy as FooDummyDocument ;
61
+ use ApiPlatform \Tests \Fixtures \TestBundle \Document \FooEmbeddable as FooEmbeddableDocument ;
61
62
use ApiPlatform \Tests \Fixtures \TestBundle \Document \FourthLevel as FourthLevelDocument ;
62
63
use ApiPlatform \Tests \Fixtures \TestBundle \Document \Greeting as GreetingDocument ;
63
64
use ApiPlatform \Tests \Fixtures \TestBundle \Document \InitializeInput as InitializeInputDocument ;
144
145
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \FileConfigDummy ;
145
146
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \Foo ;
146
147
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \FooDummy ;
148
+ use ApiPlatform \Tests \Fixtures \TestBundle \Entity \FooEmbeddable ;
147
149
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \FourthLevel ;
148
150
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \Greeting ;
149
151
use ApiPlatform \Tests \Fixtures \TestBundle \Entity \InitializeInput ;
@@ -354,7 +356,7 @@ public function thereAreFooObjectsWithFakeNames(int $nb): void
354
356
/**
355
357
* @Given there are :nb fooDummy objects with fake names
356
358
*/
357
- public function thereAreFooDummyObjectsWithFakeNames ($ nb ): void
359
+ public function thereAreFooDummyObjectsWithFakeNames (int $ nb, $ embedd = false ): void
358
360
{
359
361
$ names = ['Hawsepipe ' , 'Ephesian ' , 'Sthenelus ' , 'Separativeness ' , 'Balbo ' ];
360
362
$ dummies = ['Lorem ' , 'Ipsum ' , 'Dolor ' , 'Sit ' , 'Amet ' ];
@@ -365,6 +367,11 @@ public function thereAreFooDummyObjectsWithFakeNames($nb): void
365
367
366
368
$ foo = $ this ->buildFooDummy ();
367
369
$ foo ->setName ($ names [$ i ]);
370
+ if ($ embedd ) {
371
+ $ embeddedFoo = $ this ->buildFooEmbeddable ();
372
+ $ embeddedFoo ->setDummyName ('embedded ' .$ names [$ i ]);
373
+ $ foo ->setEmbeddedFoo ($ embeddedFoo );
374
+ }
368
375
$ foo ->setDummy ($ dummy );
369
376
for ($ j = 0 ; $ j < 3 ; ++$ j ) {
370
377
$ soMany = $ this ->buildSoMany ();
@@ -379,6 +386,14 @@ public function thereAreFooDummyObjectsWithFakeNames($nb): void
379
386
$ this ->manager ->flush ();
380
387
}
381
388
389
+ /**
390
+ * @Given there is a fooDummy objects with fake names and embeddable
391
+ */
392
+ public function thereAreFooDummyObjectsWithFakeNamesAndEmbeddable (): void
393
+ {
394
+ $ this ->thereAreFooDummyObjectsWithFakeNames (1 , true );
395
+ }
396
+
382
397
/**
383
398
* @Given there are :nb dummy group objects
384
399
*/
@@ -2399,6 +2414,11 @@ private function buildFooDummy(): FooDummy|FooDummyDocument
2399
2414
return $ this ->isOrm () ? new FooDummy () : new FooDummyDocument ();
2400
2415
}
2401
2416
2417
+ private function buildFooEmbeddable (): FooEmbeddable |FooEmbeddableDocument
2418
+ {
2419
+ return $ this ->isOrm () ? new FooEmbeddable () : new FooEmbeddableDocument ();
2420
+ }
2421
+
2402
2422
private function buildFourthLevel (): FourthLevel |FourthLevelDocument
2403
2423
{
2404
2424
return $ this ->isOrm () ? new FourthLevel () : new FourthLevelDocument ();
0 commit comments