Skip to content

Commit 11fca8c

Browse files
author
Toni Uebernickel
committed
fixup! Enable loader to retrieve subtree of fixtures
1 parent 70800fa commit 11fca8c

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

Loader/SymfonyFixturesLoader.php

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use RuntimeException;
1414
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
1515
use function array_key_exists;
16+
use function array_map;
17+
use function array_merge;
18+
use function array_reduce;
1619
use function array_values;
1720
use function get_class;
1821
use function sprintf;

Tests/Loader/ResolveFixturesSubtreeTest.php

+13-5
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,28 @@
1212
use Doctrine\Persistence\ObjectManager;
1313
use PHPUnit\Framework\TestCase;
1414
use Symfony\Component\DependencyInjection\Container;
15+
use function interface_exists;
16+
use function class_alias;
1517

1618
/**
1719
* @covers \Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader::getFixturesDependencyTree
1820
* @covers \Doctrine\Bundle\FixturesBundle\Loader\SymfonyFixturesLoader::resolveFixturesDependencyTree
1921
*/
2022
class ResolveFixturesSubtreeTest extends TestCase
2123
{
24+
/**
25+
* @var SymfonyFixturesLoader
26+
*/
2227
private $loader;
2328

24-
public static function setUpBeforeClass()
29+
public static function setUpBeforeClass() : void
2530
{
26-
if (!interface_exists(ObjectManager::class)) {
31+
if (! interface_exists(ObjectManager::class)) {
2732
class_alias('Doctrine\Common\Persistence\ObjectManager', 'Doctrine\Persistence\ObjectManager', false);
2833
}
2934
}
3035

31-
protected function setUp()
36+
protected function setUp() : void
3237
{
3338
$this->loader = new SymfonyFixturesLoader(new Container());
3439
}
@@ -95,18 +100,21 @@ public function testResolveRecursively() : void
95100
private function createFixture(array $dependencies) : FixtureInterface
96101
{
97102
return new class ($dependencies) implements FixtureInterface, DependentFixtureInterface {
103+
/**
104+
* @var string[]
105+
*/
98106
private $dependencies;
99107

100108
public function __construct(array $dependencies)
101109
{
102110
$this->dependencies = $dependencies;
103111
}
104112

105-
public function load(ObjectManager $manager)
113+
public function load(ObjectManager $manager) : void
106114
{
107115
}
108116

109-
public function getDependencies()
117+
public function getDependencies() : array
110118
{
111119
return $this->dependencies;
112120
}

0 commit comments

Comments
 (0)