diff --git a/README.md b/README.md index 78cd488b..65ceb9b7 100644 --- a/README.md +++ b/README.md @@ -340,8 +340,8 @@ Tips for Fixture Loading Tests ``` 4. If you don't need any fixtures to be loaded and just want to start off with - an empty database (initialized with your schema), you can simply pass an - empty array to `loadFixtures`. + an empty database (initialized with your schema), you can simply call + `loadFixtures` without any argument. ```php use Liip\FunctionalTestBundle\Test\WebTestCase; @@ -350,7 +350,7 @@ Tips for Fixture Loading Tests { public function testIndex() { - $this->loadFixtures(array()); + $this->loadFixtures(); // you can now run your functional tests with a populated database $client = $this->createClient(); diff --git a/src/Test/WebTestCase.php b/src/Test/WebTestCase.php index 3414260e..e317a385 100644 --- a/src/Test/WebTestCase.php +++ b/src/Test/WebTestCase.php @@ -338,7 +338,7 @@ protected function isBackupUpToDate(array $classNames, $backup) * * @return null|AbstractExecutor */ - protected function loadFixtures(array $classNames, $omName = null, $registryName = 'doctrine', $purgeMode = null) + protected function loadFixtures(array $classNames = [], $omName = null, $registryName = 'doctrine', $purgeMode = null) { $container = $this->getContainer(); /** @var ManagerRegistry $registry */ diff --git a/tests/Test/WebTestCaseTest.php b/tests/Test/WebTestCaseTest.php index e6963e72..b3eda813 100644 --- a/tests/Test/WebTestCaseTest.php +++ b/tests/Test/WebTestCaseTest.php @@ -287,6 +287,16 @@ public function testLoadEmptyFixtures() ); } + public function testLoadFixturesWithoutParameters() + { + $fixtures = $this->loadFixtures(); + + $this->assertInstanceOf( + 'Doctrine\Common\DataFixtures\Executor\ORMExecutor', + $fixtures + ); + } + public function testLoadFixtures() { $fixtures = $this->loadFixtures([