Example #1
0
 /**
  * @group DoctrineODMMongoDBHydrator
  */
 public function testSkipWhenHydratorsAreAutoGenerated()
 {
     $testManager = $this->createTestDocumentManager(array(__DIR__ . "/../DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Document"));
     $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
     $container->expects($this->at(0))->method('getParameter')->with($this->equalTo('doctrine.odm.mongodb.hydrator_dir'))->will($this->returnValue(sys_get_temp_dir()));
     $container->expects($this->at(1))->method('getParameter')->with($this->equalTo('doctrine.odm.mongodb.auto_generate_hydrator_classes'))->will($this->returnValue(true));
     $container->expects($this->at(2))->method('getParameter')->with($this->equalTo('assertion'))->will($this->returnValue(true));
     $cacheWarmer = new HydratorCacheWarmer($container);
     $cacheWarmer->warmUp(sys_get_temp_dir());
     $container->getParameter('assertion');
     // check that the assertion is really the third call.
 }
 /**
  * @dataProvider provideWarmerNotExecuted
  */
 public function testWarmerNotExecuted($autoGenerate)
 {
     $this->container->setParameter('doctrine_mongodb.odm.auto_generate_hydrator_classes', $autoGenerate);
     $this->hydratorMock->expects($this->exactly(0))->method('generateHydratorClasses');
     $this->warmer->warmUp('meh');
 }