/** * @expectedException \Hautelook\AliceBundle\Alice\DataFixtures\LoadingLimitException */ public function testLoaderWithCustomLimit() { $persisterProphecy = $this->prophesize('Nelmio\\Alice\\PersisterInterface'); $persisterProphecy->persist()->shouldNotBeCalled(); $fixturesLoaderProphecy = $this->prophesize('Hautelook\\AliceBundle\\Alice\\DataFixtures\\Fixtures\\LoaderInterface'); $fixturesLoaderProphecy->load('random/file', [])->willThrow(new \UnexpectedValueException()); $fixturesLoaderProphecy->load('random/file', [])->shouldBeCalledTimes(11); $loader = new Loader($fixturesLoaderProphecy->reveal(), [], false); $loader->setLoadingLimit(10); $loader->load($persisterProphecy->reveal(), ['random/file']); }