private function loadExtension(array $config, $compile = true) { $config = array_merge(['transports' => ['amqp' => []]], $config); $this->extension->load(['event_band' => $config], $this->container); $this->container->getCompilerPassConfig()->setRemovingPasses(array()); if ($compile) { $this->container->compile(); } }
/** * @test definition parameter format ""|"type"|"type:name" will find definitions and pass to configurator * @dataProvider definitions */ public function definitionConfigurator($name, $definitions) { $configurator = $this->getMock('EventBand\\Transport\\TransportConfigurator'); $configurator->expects($this->once())->method('setUpDefinition')->with($definitions); $this->container->expects($this->any())->method('get')->will($this->returnCallback(function ($id) use($configurator) { if ($id === EventBandExtension::getTransportConfiguratorId()) { return $configurator; } return 'object_' . $id; })); $this->container->expects($this->once())->method('getParameter')->with('event_band.transport_definitions')->will($this->returnValue(['test' => ['name1' => 'id1', 'name2' => 'id2']])); $this->tester->execute(['command' => 'event-band:setup', 'definition' => $name]); }
/** * {@inheritDoc} */ protected function getConfigurator() { return $this->getContainer()->get(EventBandExtension::getTransportConfiguratorId()); }