From c1ada37aa397f459531b4e7f852d97a2a38a3265 Mon Sep 17 00:00:00 2001 From: Nicolas Bastien Date: Sat, 21 Mar 2015 17:42:14 +0100 Subject: [PATCH] #143 : make nelmio/alice optinal --- Test/WebTestCase.php | 10 ++++++++-- composer.json | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Test/WebTestCase.php b/Test/WebTestCase.php index 62a74cb7..1eb469b5 100644 --- a/Test/WebTestCase.php +++ b/Test/WebTestCase.php @@ -364,12 +364,18 @@ protected function loadFixtures(array $classNames, $omName = null, $registryName /** * @param array $paths - * @param bool $append + * @param bool $append + * @param null $omName + * @param string $registryName * - * @return $this + * @throws \BadMethodCallException */ public function loadFixtureFiles(array $paths = [], $append = false, $omName = null, $registryName = 'doctrine') { + if (!class_exists('Nelmio\Alice\Fixtures')) { + throw new \BadMethodCallException('nelmio/alice should be installed to use this method.'); + } + $om = $this->getObjectManager($omName, $registryName); if ($append == false) { diff --git a/composer.json b/composer.json index 61024ad9..88e154d5 100644 --- a/composer.json +++ b/composer.json @@ -18,13 +18,13 @@ "php": ">=5.3.2", "symfony/framework-bundle": "~2.0", "symfony/browser-kit": "~2.0", - "doctrine/common": "2.*", - "nelmio/alice": "~1.7" + "doctrine/common": "2.*" }, "suggest": { "doctrine/doctrine-fixtures-bundle": "Required when using the fixture loading functionality", "doctrine/orm": "Required when using the fixture loading functionality with an ORM and SQLite", - "doctrine/dbal": "Required when using the fixture loading functionality with an ORM and SQLite" + "doctrine/dbal": "Required when using the fixture loading functionality with an ORM and SQLite", + "nelmio/alice": "Required when using loadFixtureFiles functionality" }, "autoload": { "psr-4": {