Esempio n. 1
0
 public function testServiceDefinition()
 {
     $service = new ServiceDefinition('Foo\\Bar', 'Test', true);
     $this->assertEquals('Foo\\Bar', $service->getNamespace());
     $this->assertEquals('Test', $service->getClassName());
     $this->assertEquals(null, $service->getServices());
     $this->assertTrue($service->isDryRun());
     $service->setNamespace('Bar\\Foo');
     $service->setClassName('Foo');
     $service->setServices(array('connection'));
     $this->assertEquals('Bar\\Foo', $service->getNamespace());
     $this->assertEquals('Foo', $service->getClassName());
     $this->assertEquals(array('connection'), $service->getServices());
 }
 /**
  * @param string $serviceId
  * @param ServiceDefinition $proxyServiceDefinition
  * @return void
  */
 public function replaceServiceDefinition($serviceId, ServiceDefinition $proxyServiceDefinition)
 {
     $this->configuration['services'][$serviceId] = array('serviceId' => $serviceId, 'class' => $proxyServiceDefinition->getClassName(), 'arguments' => $proxyServiceDefinition->getConstructorArguments(), 'setup' => $proxyServiceDefinition->getSetupMethods());
 }