Exemplo n.º 1
0
 /**
  * Tests that the correct RuntimeException is thrown for dumping a resource.
  *
  * @covers ::dumpValue
  *
  * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
  */
 public function testGetServiceDefinitionForResource()
 {
     $resource = fopen('php://memory', 'r');
     $bar_definition = new Definition('\\stdClass');
     $bar_definition->addArgument($resource);
     $services['bar'] = $bar_definition;
     $this->containerBuilder->getDefinitions()->willReturn($services);
     $this->dumper->getArray();
 }
 private function _getDumpedSymfonyContainerAsString(\Symfony\Component\DependencyInjection\ContainerBuilder $containerBuilder)
 {
     if ($this->_shouldLog) {
         $this->_logDebug('Preparing to dump container builder to string');
     }
     $dumpConfig = array('class' => 'TubePressServiceContainer');
     if (!isset($this->_containerDumper)) {
         $this->_containerDumper = new \Symfony\Component\DependencyInjection\Dumper\PhpDumper($containerBuilder);
     }
     $dumped = $this->_containerDumper->dump($dumpConfig);
     if ($this->_shouldLog) {
         $this->_logDebug(sprintf('Done dumping container builder to string. Check the HTML source to view the full' . ' container. <div style="display:none"><pre>%s</pre></div>', $dumped));
     }
     return $dumped;
 }