Browse Source

Add support for service factories (#283)

* Add support for service factories
* Housekeeping
master
Théo FIDRY 6 years ago committed by GitHub
parent
commit
2db5b76fc9
  1. 24
      .php_cs
  2. 15
      .styleci.yml
  3. 12
      .travis.yml
  4. 5
      README.md
  5. 12
      bin/clear_cache.sh
  6. 28
      composer.json
  7. 17
      doc/advanced-usage.md
  8. 4
      fixtures/Functional/AppKernel.php
  9. 2
      fixtures/Functional/ConfigurableKernel.php
  10. 28
      fixtures/Functional/TestBundle/Entity/CityFactory.php
  11. 2
      fixtures/Functional/TestKernel.php
  12. 21
      fixtures/Functional/config/config.yml
  13. 11
      fixtures/HttpKernel/DummyKernel.php
  14. 5
      fixtures/fixture_files/city.yml
  15. 18
      resources/config/alice.xml
  16. 135
      src/Alice/Generator/Instantiator/Chainable/InstantiatedReferenceInstantiator.php
  17. 194
      tests/Alice/Generator/Instantiator/Chainable/InstantiatedReferenceInstantiatorTest.php
  18. 45
      tests/Alice/Loader/ServiceFactoryTest.php
  19. 7
      tests/Console/Command/Doctrine/LoadDataFixturesCommandTest.php

24
.php_cs

@ -1,24 +0,0 @@
<?php
require_once __DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php';
use SLLH\StyleCIBridge\ConfigBridge;
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
$header = <<<EOF
This file is part of the Hautelook\AliceBundle package.
(c) Baldur Rensch <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
HeaderCommentFixer::setHeader($header);
$config = ConfigBridge::create();
return $config
->setUsingCache(true)
->fixers(array_merge($config->getFixers(), ['-psr0']))
;

15
.styleci.yml

@ -1,15 +0,0 @@
preset: symfony
enabled:
- align_double_arrow
- newline_after_open_tag
- ordered_use
- short_array_syntax
disabled:
- unalign_double_arrow
- unalign_equals
finder:
exclude:
- tests/Functional/cache

12
.travis.yml

@ -16,6 +16,11 @@ env:
- PHPUNIT_CONFIG='phpunit.xml.dist'
- PHPUNIT_FLAGS='--stop-on-failure --verbose'
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.bin/
services:
- mysql
@ -26,7 +31,7 @@ matrix:
env:
- COMPOSER_FLAGS="--prefer-lowest"
- COVERAGE="true"
- PHPUNIT_FLAGS="--coverage-text --coverage-clover=coverage.xml"
- PHPUNIT_FLAGS="--stop-on-failure --verbose --coverage-text --coverage-clover=coverage.xml"
- SYMFONY_VERSION="~3.1.0"
- php: '7.0'
env: SYMFONY_VERSION='[email protected]'
@ -35,11 +40,6 @@ matrix:
- php: '7.1'
- env: SYMFONY_VERSION='[email protected]'
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.bin/
before_install:
- set -eo pipefail
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

5
README.md

@ -25,9 +25,10 @@ project to know which database/ORM is supported.
3. [Advanced usage](doc/advanced-usage.md)
1. [Enabling databases](doc/advanced-usage.md#enabling-databases)
2. [Environment specific fixtures](doc/advanced-usage.md#environment-specific-fixtures)
2. [Fixtures parameters](doc/advanced-usage.md#fixtures-parameters)
3. [Fixtures parameters](doc/advanced-usage.md#fixtures-parameters)
1. [Alice parameters](doc/advanced-usage.md#alice-parameters)
1. [Application parameters](doc/advanced-usage.md#application-parameters)
2. [Application parameters](doc/advanced-usage.md#application-parameters)
4. [Use service factories](doc/advanced-usage.md#use-service-factories)
4. [Custom Faker Providers](doc/faker-providers.md)
5. [Custom Alice Processors](doc/alice-processors.md)
7. [Resources](#resources)

12
bin/clear_cache.sh

@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# This file is part of the Hautelook\AliceBundle package.
#
# (c) Baldur Rensch <[email protected]>
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
rm -rf fixtures/Functional/cache/*ch

28
composer.json

@ -33,32 +33,16 @@
"symfony/finder": "^2.7||^3.0"
},
"require-dev": {
"sllh/php-cs-fixer-styleci-bridge": "^1.0",
"symfony/console": "^2.3||~3.0",
"symfony/framework-bundle": "^2.3||^3.0",
"symfony/phpunit-bridge": "^2.7.4||^3.0",
"symfony/yaml": "^2.3||^3.0",
"symfony/validator": "^2.3|^3.0",
"bamarni/composer-bin-plugin": "dev-master",
"theofidry/alice-data-fixtures": "^[email protected]",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/data-fixtures": "^1.2",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"phpunit/phpunit": "^5.6",
"theofidry/psysh-bundle": "^2.0",
"symfony/monolog-bundle": "^2.11",
"easycorp/easy-log-handler": "^1.0"
"symfony/symfony": "^2.3||~3.0",
"symfony/phpunit-bridge": "^3.1",
"theofidry/alice-data-fixtures": "^[email protected]"
},
"suggest": {
"theofidry/alice-bundle-extension": "Behat extension for HautelookAliceBundle",
"doctrine/data-fixtures": "To use Doctrine fixtures loader",
"doctrine/orm": "To use Doctrine ORM",
"doctrine/doctrine-bundle": "To use Doctrine with Symfony",
"doctrine/mongodb-odm": "To use Doctrine MongoDB",
"doctrine/mongodb-odm-bundle": "To use Doctrine MongoDB with Symfony",
"jackalope/jackalope-doctrine-dbal": "To use Doctrine PHPCR",
"doctrine/phpcr-odm": "To use Doctrine PHPCR ODM",
"doctrine/phpcr-bundle": "To use Doctrine PHPCR ODM with Symfony"
"theofidry/alice-bundle-extension": "Behat extension for HautelookAliceBundle"
},
"extra": {
"branch-alias": {

17
doc/advanced-usage.md

@ -72,7 +72,7 @@ For more, check [Alice documentation](https://github.com/nelmio/alice#table-of-c
You can access out of the box to your application parameters:
```yaml
# AppBundle/DataFixtures/ORM/dummy.yml
# app/Resources/fixtures/orm/dummy.yml
AppBundle\Entity\Dummy:
dummy_0:
@ -83,5 +83,20 @@ Alice parameters will **not** be injected in your application `ParameterBag`, i.
fixtures.
# Use service factories
If your entity `AppBundle\Entity\Dummy` requires a factory registered as a service (Alice already supports [static
factories](https://github.com/nelmio/alice/blob/master/doc/complete-reference.md#specifying-constructor-arguments)) to
`dummy_factory` be instantiated, you can specify it as a constructor:
```yaml
# app/Resources/fixtures/orm/dummy.yml
AppBundle\Entity\Dummy:
dummy_0:
__construct: { '@dummy_factory::create': ['<username()>'] }
```
Previous chapter: [Basic usage](../README.md#basic-usage)<br />
Next chapter: [Custom Faker Providers](faker-providers.md)

4
fixtures/Functional/AppKernel.php

@ -13,11 +13,9 @@ namespace Hautelook\AliceBundle\Functional;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle;
use Fidry\PsyshBundle\PsyshBundle;
use Hautelook\AliceBundle\HautelookAliceBundle;
use Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
@ -30,12 +28,10 @@ class AppKernel extends Kernel
{
return [
new FrameworkBundle(),
new MonologBundle(),
new NelmioAliceBundle(),
new FidryAliceDataFixturesBundle(),
new DoctrineBundle(),
new HautelookAliceBundle(),
new PsyshBundle(),
];
}

2
fixtures/Functional/ConfigurableKernel.php

@ -13,7 +13,6 @@ namespace Hautelook\AliceBundle\Functional;
use Hautelook\AliceBundle\HautelookAliceBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
@ -33,7 +32,6 @@ class ConfigurableKernel extends Kernel
return array_merge(
[
new FrameworkBundle(),
new MonologBundle(),
new HautelookAliceBundle(),
],
$this->addedBundles

28
fixtures/Functional/TestBundle/Entity/CityFactory.php

@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Hautelook\AliceBundle package.
*
* (c) Baldur Rensch <brensch@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace Hautelook\AliceBundle\Functional\TestBundle\Entity;
/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class CityFactory
{
public function create(string $name): City
{
$instance = new City();
$instance->name = $name;
return $instance;
}
}

2
fixtures/Functional/TestKernel.php

@ -20,7 +20,6 @@ use Hautelook\AliceBundle\HautelookAliceBundle;
use Hautelook\AliceBundle\Functional\TestBundle\TestBundle;
use Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\MonologBundle\MonologBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
@ -33,7 +32,6 @@ class TestKernel extends Kernel
{
return [
new FrameworkBundle(),
new MonologBundle(),
new NelmioAliceBundle(),
new FidryAliceDataFixturesBundle(),
new DoctrineBundle(),

21
fixtures/Functional/config/config.yml

@ -13,24 +13,13 @@ framework:
session: ~
test: ~
monolog:
handlers:
buffered:
type: buffer
handler: easylog
level: debug
easylog:
type: service
id: easycorp.easylog.handler
console:
type: console
services:
data_fixtures.faker.provider.foo:
class: Hautelook\AliceBundle\Functional\TestBundle\DataFixtures\Faker\Provider\FooProvider
tags: [ { name: nelmio_alice.faker.provider } ]
easycorp.easylog.handler:
class: EasyCorp\EasyLog\EasyLogHandler
arguments:
- '%kernel.logs_dir%/%kernel.environment%.log'
app.city_factory:
class: Hautelook\AliceBundle\Functional\TestBundle\Entity\CityFactory
logger:
class: Psr\Log\NullLogger

11
fixtures/HttpKernel/DummyKernel.php

@ -172,4 +172,13 @@ class DummyKernel implements KernelInterface
public function getCharset()
{
$this->__call(__METHOD__, func_get_args());
}}
}
/**
* @inheritdoc
*/
public function isClassInActiveBundle($class)
{
$this->__call(__METHOD__, func_get_args());
}
}

5
fixtures/fixture_files/city.yml

@ -0,0 +1,5 @@
Hautelook\AliceBundle\Functional\TestBundle\Entity\City:
city_{0..10}:
__construct:
'@app.city_factory::create':
- <current()>

18
resources/config/alice.xml

@ -0,0 +1,18 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="hautelook_alice.alice.generator.instantiator.chainable.instantiated_reference_instantiator"
class="Hautelook\AliceBundle\Alice\Generator\Instantiator\Chainable\InstantiatedReferenceInstantiator">
<call method="setContainer">
<argument type="service" id="service_container" />
</call>
<tag name="nelmio_alice.generator.instantiator.chainable_instantiator" />
</service>
</services>
</container>

135
src/Alice/Generator/Instantiator/Chainable/InstantiatedReferenceInstantiator.php

@ -0,0 +1,135 @@
<?php
/*
* This file is part of the Hautelook\AliceBundle package.
*
* (c) Baldur Rensch <brensch@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace Hautelook\AliceBundle\Alice\Generator\Instantiator\Chainable;
use Nelmio\Alice\Definition\MethodCall\MethodCallWithReference;
use Nelmio\Alice\Definition\Object\SimpleObject;
use Nelmio\Alice\Definition\ServiceReference\InstantiatedReference;
use Nelmio\Alice\Exception\Generator\Instantiator\InstantiationException;
use Nelmio\Alice\FixtureInterface;
use Nelmio\Alice\Generator\GenerationContext;
use Nelmio\Alice\Generator\Instantiator\ChainableInstantiatorInterface;
use Nelmio\Alice\Generator\ResolvedFixtureSet;
use Nelmio\Alice\NotClonableTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
final class InstantiatedReferenceInstantiator implements ChainableInstantiatorInterface, ContainerAwareInterface
{
use NotClonableTrait;
/**
* @var ContainerInterface|null
*/
private $container;
/**
* @inheritdoc
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
/**
* @inheritDoc
*/
public function canInstantiate(FixtureInterface $fixture): bool
{
$constructor = $fixture->getSpecs()->getConstructor();
return (
null !== $constructor
&& $constructor instanceof MethodCallWithReference
&& $constructor->getCaller() instanceof InstantiatedReference
);
}
/**
* @inheritdoc
*/
public function instantiate(
FixtureInterface $fixture,
ResolvedFixtureSet $fixtureSet,
GenerationContext $context
): ResolvedFixtureSet
{
$this->checkContainer(__METHOD__);
$instance = $this->createInstance($fixture);
return $this->generateSet($fixture, $fixtureSet, $instance);
}
private function checkContainer(string $method)
{
if (null === $this->container) {
throw new \LogicException(
sprintf(
'Expected instantiator method "%s" to be used only if it has a container, but no container could'
.' be found.',
$method
)
);
}
}
private function createInstance(FixtureInterface $fixture)
{
$constructor = $fixture->getSpecs()->getConstructor();
list($class, $factoryReference, $method, $arguments) = [
$fixture->getClassName(),
$constructor->getCaller()->getId(),
$constructor->getMethod(),
$constructor->getArguments()
];
if (null === $arguments) {
$arguments = [];
}
$factory = $this->container->get($factoryReference);
$instance = $factory->$method(...$arguments);
if (false === $instance instanceof $class) {
throw new InstantiationException(
sprintf(
'Instantiated fixture was expected to be an instance of "%s". Got "%s" instead.',
$class,
get_class($instance)
)
);
}
return $instance;
}
private function generateSet(
FixtureInterface $fixture,
ResolvedFixtureSet $fixtureSet,
$instance
): ResolvedFixtureSet
{
$objects = $fixtureSet->getObjects()->with(
new SimpleObject(
$fixture->getId(),
$instance
)
);
return $fixtureSet->withObjects($objects);
}
}

194
tests/Alice/Generator/Instantiator/Chainable/InstantiatedReferenceInstantiatorTest.php

@ -0,0 +1,194 @@
<?php
/*
* This file is part of the Hautelook\AliceBundle package.
*
* (c) Baldur Rensch <brensch@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace Hautelook\AliceBundle\Alice\Generator\Instantiator\Chainable;
use Hautelook\AliceBundle\Functional\TestBundle\Entity\City;
use Hautelook\AliceBundle\Functional\TestBundle\Entity\CityFactory;
use Nelmio\Alice\Definition\Fixture\SimpleFixture;
use Nelmio\Alice\Definition\MethodCall\MethodCallWithReference;
use Nelmio\Alice\Definition\MethodCallBag;
use Nelmio\Alice\Definition\PropertyBag;
use Nelmio\Alice\Definition\ServiceReference\InstantiatedReference;
use Nelmio\Alice\Definition\ServiceReference\StaticReference;
use Nelmio\Alice\Definition\SpecificationBag;
use Nelmio\Alice\FixtureBag;
use Nelmio\Alice\Generator\GenerationContext;
use Nelmio\Alice\Generator\Instantiator\ChainableInstantiatorInterface;
use Nelmio\Alice\Generator\ResolvedFixtureSet;
use Nelmio\Alice\ObjectBag;
use Nelmio\Alice\ParameterBag;
use Symfony\Component\DependencyInjection\Container;
/**
* @covers \Hautelook\AliceBundle\Alice\Generator\Instantiator\Chainable\InstantiatedReferenceInstantiator
*
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class InstantiatedReferenceInstantiatorTest extends \PHPUnit_Framework_TestCase
{
public function testIsAChainableInstantiator()
{
$this->assertTrue(is_a(InstantiatedReferenceInstantiator::class, ChainableInstantiatorInterface::class, true));
}
/**
* @expectedException \DomainException
*/
public function testIsNotClonable()
{
clone new InstantiatedReferenceInstantiator();
}
public function testCannotInstantiateFixtureWithDefaultConstructor()
{
$fixture = new SimpleFixture('dummy', 'Dummy', new SpecificationBag(null, new PropertyBag(), new MethodCallBag()));
$instantiator = new InstantiatedReferenceInstantiator();
$this->assertFalse($instantiator->canInstantiate($fixture));
}
public function testCannotInstantiateFixtureWithStaticFactoryMethodCallConstructor()
{
$fixture = new SimpleFixture(
'dummy',
'Dummy',
new SpecificationBag(
new MethodCallWithReference(
new StaticReference('foo'),
'bar'
),
new PropertyBag(),
new MethodCallBag()
)
);
$instantiator = new InstantiatedReferenceInstantiator();
$this->assertFalse($instantiator->canInstantiate($fixture));
}
public function testCanInstantiateFixtureWitAServiceReferenceFactory()
{
$fixture = new SimpleFixture(
'dummy',
'Dummy',
new SpecificationBag(
new MethodCallWithReference(
new InstantiatedReference('foo'),
'bar'
),
new PropertyBag(),
new MethodCallBag()
)
);
$instantiator = new InstantiatedReferenceInstantiator();
$this->assertTrue($instantiator->canInstantiate($fixture));
}
/**
* @expectedException \LogicException
* @expectedExceptionMessage Expected instantiator method "Hautelook\AliceBundle\Alice\Generator\Instantiator\Chainable\InstantiatedReferenceInstantiator::instantiate" to be used only if it has a container, but no container could be found.
*/
public function testThrowsAnExceptionIfNoContainerIsSetWhilstTryingToInstantiateObject()
{
$fixture = new SimpleFixture(
'dummy',
City::class,
new SpecificationBag(
new MethodCallWithReference(
new InstantiatedReference(
'city_factory'
),
'create',
[
'foo',
]
),
new PropertyBag(),
new MethodCallBag()
)
);
$set = new ResolvedFixtureSet(new ParameterBag(), (new FixtureBag())->with($fixture), new ObjectBag());
$instantiator = new InstantiatedReferenceInstantiator();
$instantiator->instantiate($fixture, $set, new GenerationContext());
}
public function testInstantiatesObjectWithFactoryAndArguments()
{
$fixture = new SimpleFixture(
'dummy',
City::class,
new SpecificationBag(
new MethodCallWithReference(
new InstantiatedReference(
'city_factory'
),
'create',
[
'foo',
]
),
new PropertyBag(),
new MethodCallBag()
)
);
$container = new Container();
$container->set('city_factory', $cityFactory = new CityFactory());
$instantiator = new InstantiatedReferenceInstantiator();
$instantiator->setContainer($container);
$set = new ResolvedFixtureSet(new ParameterBag(), (new FixtureBag())->with($fixture), new ObjectBag());
$set = $instantiator->instantiate($fixture, $set, new GenerationContext());
$expected = $cityFactory->create('foo');
$actual = $set->getObjects()->get($fixture)->getInstance();
$this->assertEquals($expected, $actual);
}
/**
* @expectedException \Nelmio\Alice\Exception\Generator\Instantiator\InstantiationException
* @expectedExceptionMessage Instantiated fixture was expected to be an instance of "Dummy". Got "Hautelook\AliceBundle\Functional\TestBundle\Entity\City" instead.
*/
public function testThrowsAnExceptionIfTheInstantiatedFixtureIsNotOfTheClassExpected()
{
$fixture = new SimpleFixture(
'dummy',
'Dummy',
new SpecificationBag(
new MethodCallWithReference(
new InstantiatedReference(
'city_factory'
),
'create',
[
'foo',
]
),
new PropertyBag(),
new MethodCallBag()
)
);
$container = new Container();
$container->set('city_factory', $cityFactory = new CityFactory());
$instantiator = new InstantiatedReferenceInstantiator();
$instantiator->setContainer($container);
$set = new ResolvedFixtureSet(new ParameterBag(), (new FixtureBag())->with($fixture), new ObjectBag());
$instantiator->instantiate($fixture, $set, new GenerationContext());
}
}

45
tests/Alice/Loader/ServiceFactoryTest.php

@ -0,0 +1,45 @@
<?php
/*
* This file is part of the Hautelook\AliceBundle package.
*
* (c) Baldur Rensch <brensch@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace Hautelook\AliceBundle\Tests\Alice\Loader;
use Hautelook\AliceBundle\Functional\TestBundle\Entity\CityFactory;
use Hautelook\AliceBundle\Functional\TestKernel;
/**
* @coversNothing
*
* @author Théo FIDRY <theo.fidry@gmail.com>
*/
class ServiceFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testCanUseServiceFactory()
{
$kernel = new TestKernel('ServiceFactoryTest', true);
$kernel->boot();
$loader = $kernel->getContainer()->get('nelmio_alice.file_loader');
$set = $loader->loadFile(__DIR__.'/../../../fixtures/fixture_files/city.yml');
$cityFactory = new CityFactory();
$expected = [];
for ($i = 0; $i <= 10; $i++) {
$expected['city_'.$i] = $cityFactory->create((string) $i);
}
$this->assertEquals(count($expected), count($set->getObjects()));
$this->assertEquals($expected, $set->getObjects());
$kernel->shutdown();
}
}

7
tests/Console/Command/Doctrine/LoadDataFixturesCommandTest.php

@ -68,7 +68,9 @@ class LoadDataFixturesCommandTest extends \PHPUnit_Framework_TestCase
$application = new FrameworkBundleConsoleApplication(new DummyKernel());
$application->setAutoExit(false);
$input = new ArrayInput([]);
$input = new ArrayInput([
'command' => 'hautelook:fixtures:load',
]);
$input->setInteractive(false);
/** @var ManagerRegistry|ObjectProphecy $managerRegistryProphecy */
@ -81,7 +83,7 @@ class LoadDataFixturesCommandTest extends \PHPUnit_Framework_TestCase
$loaderProphecy = $this->prophesize(LoaderInterface::class);
$loaderProphecy
->load($application, $manager, [], 'fake_env', false, false, null)
->shouldBeCalled();
->shouldBeCalled()
;
/** @var LoaderInterface $loader */
$loader = $loaderProphecy->reveal();
@ -101,6 +103,7 @@ class LoadDataFixturesCommandTest extends \PHPUnit_Framework_TestCase
$application->setAutoExit(false);
$input = new ArrayInput([
'command' => 'hautelook:fixtures:load',
'--manager' => 'DummyManager',
'--env' => 'dummy_env',
'--bundle' => [

Loading…
Cancel
Save