예제 #1
0
 /**
  * @test
  */
 public function solrListensToOdmAndOrmEvents()
 {
     $config = $this->commonConfig();
     $this->enableOdmConfig();
     $this->enableOrmConfig();
     $extension = new FSSolrExtension();
     $extension->load($config, $this->container);
     $this->assertTrue($this->container->has('solr.document.odm.subscriber'), 'odm subscriber');
     $this->assertDefinitionHasTag('solr.document.odm.subscriber', 'doctrine_mongodb.odm.event_subscriber');
     $this->assertTrue($this->container->has('solr.document.orm.subscriber'), 'orm subscriber');
     $this->assertDefinitionHasTag('solr.document.orm.subscriber', 'doctrine.event_subscriber');
 }
예제 #2
0
 public function testDoctrineODMSetup()
 {
     $config = $this->commonConfig();
     $this->container->setParameter('doctrine_mongodb.odm.document_managers', true);
     $extension = new FSSolrExtension();
     $extension->load($config, $this->container);
     $this->assertTrue($this->container->has('solr.update.document.odm.listener'), 'update listener');
     $this->assertTrue($this->container->has('solr.delete.document.odm.listener'), 'delete listener');
     $this->assertTrue($this->container->has('solr.add.document.odm.listener'), 'insert listener');
     $this->assertDefinitionHasTag('solr.update.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $this->assertDefinitionHasTag('solr.delete.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $this->assertDefinitionHasTag('solr.add.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $doctrineArguments = $this->container->getDefinition('solr.doctrine.configuration')->getArguments();
     $arguments = array_pop($doctrineArguments);
     $doctrineConfiguration = $arguments;
     $this->assertEquals('doctrine_mongodb.odm.default_configuration', $doctrineConfiguration);
 }
예제 #3
0
 /**
  * @test
  */
 public function solrListensToOdmAndOrmEvents()
 {
     $config = $this->commonConfig();
     $this->enableOdmConfig();
     $this->enableOrmConfig();
     $extension = new FSSolrExtension();
     $extension->load($config, $this->container);
     $this->assertTrue($this->container->has('solr.update.document.odm.listener'), 'update listener');
     $this->assertTrue($this->container->has('solr.delete.document.odm.listener'), 'delete listener');
     $this->assertTrue($this->container->has('solr.add.document.odm.listener'), 'insert listener');
     $this->assertDefinitionHasTag('solr.update.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $this->assertDefinitionHasTag('solr.delete.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $this->assertDefinitionHasTag('solr.add.document.odm.listener', 'doctrine_mongodb.odm.event_listener');
     $this->assertTrue($this->container->has('solr.update.document.orm.listener'), 'update listener');
     $this->assertTrue($this->container->has('solr.delete.document.orm.listener'), 'delete listener');
     $this->assertTrue($this->container->has('solr.add.document.orm.listener'), 'insert listener');
     $this->assertDefinitionHasTag('solr.update.document.orm.listener', 'doctrine.event_listener');
     $this->assertDefinitionHasTag('solr.delete.document.orm.listener', 'doctrine.event_listener');
     $this->assertDefinitionHasTag('solr.add.document.orm.listener', 'doctrine.event_listener');
 }