public function test_can_boot_service_provider_with_two_connection()
 {
     $this->registry->shouldReceive('getManagers')->once()->andReturn(['default' => $this->em, 'custom' => $this->em]);
     $this->em->shouldReceive('getConfiguration')->twice()->andReturn($this->configuration);
     $this->configuration->shouldReceive('getMetadataDriverImpl')->twice()->andReturn($this->chain);
     $this->chain->shouldReceive('getReader')->twice()->andReturn($this->reader);
     $this->chain->shouldReceive('addDriver')->twice();
     $this->app->shouldReceive('make')->with('config')->twice()->andReturn($this->config);
     $this->config->shouldReceive('get')->with('doctrine.gedmo.all_mappings', false)->twice()->andReturn(true);
     $this->provider->boot($this->registry);
 }
Example #2
0
 protected function enableLaravelNamingStrategy()
 {
     $strategy = m::mock(LaravelNamingStrategy::class);
     $this->container->shouldReceive('make')->with(LaravelNamingStrategy::class)->once()->andReturn($strategy);
     $this->configuration->shouldReceive('setNamingStrategy')->once()->with($strategy);
 }