protected function expectDefinition($id, tubepress_api_ioc_DefinitionInterface $definition)
 {
     $this->_startChain($definition->getClass());
     $this->_expectedServiceConstructions[$id] = $definition;
     $this->_mockContainer->shouldReceive('setDefinition')->once()->with($id, Mockery::on(function ($actualDefinition) use($definition) {
         return $actualDefinition instanceof tubepress_api_ioc_DefinitionInterface && $actualDefinition->getClass() === $definition->getClass();
     }))->andReturn($this->_mockDefinition);
     return $this;
 }
 /**
  * Gets the configurator to call after the service is fully initialized.
  *
  * @return callable The PHP callable to call
  *
  * @api
  */
 public function getConfigurator()
 {
     return $this->_delegate->getConfigurator();
 }
Esempio n. 3
0
 public function toSymfonyDefinition(tubepress_api_ioc_DefinitionInterface $definition)
 {
     if ($definition instanceof tubepress_internal_ioc_Definition) {
         return $definition->getUnderlyingSymfonyDefinition();
     }
     $cleanedArguments = $this->convertToSymfonyReferenceIfNecessary($definition->getArguments());
     $cleanedMethodCalls = $this->convertToSymfonyReferenceIfNecessary($definition->getMethodCalls());
     $toReturn = new \Symfony\Component\DependencyInjection\Definition($definition->getClass(), $cleanedArguments);
     $toReturn->setConfigurator($definition->getConfigurator());
     $toReturn->setDecoratedService($definition->getDecoratedService());
     $toReturn->setFactoryClass($definition->getFactoryClass());
     $toReturn->setFactoryMethod($definition->getFactoryMethod());
     $toReturn->setFactoryService($definition->getFactoryService());
     $toReturn->setFile($definition->getFile());
     $toReturn->setMethodCalls($cleanedMethodCalls);
     $toReturn->setProperties($definition->getProperties());
     $toReturn->setTags($definition->getTags());
     return $toReturn;
 }