function it_uses_container_dump_to_create_the_cache(Filesystem $filesystem, ContainerDumperFactory $dumperFactory, ContainerBuilder $containerBuilder, PhpDumper $dumper)
 {
     $dumper->dump()->willReturn('file contents');
     $dumperFactory->create($containerBuilder)->willReturn($dumper);
     $this->dump($containerBuilder);
     $filesystem->dumpFile($this->path, 'file contents')->shouldHaveBeenCalled();
 }
 function it_uses_config_cache_to_create_the_cache(Filesystem $filesystem, ContainerDumperFactory $dumperFactory, ContainerBuilder $containerBuilder, PhpDumper $dumper, ConfigCache $configCache)
 {
     $dumper->dump()->willReturn('file contents');
     $dumperFactory->create($containerBuilder)->willReturn($dumper);
     $containerBuilder->getResources()->willReturn([]);
     $this->dump($containerBuilder);
     $configCache->write('file contents', [])->shouldHaveBeenCalled();
 }
 /**
  * @param ContainerBuilder $containerBuilder
  */
 public function dump(ContainerBuilder $containerBuilder)
 {
     $dumper = $this->dumperFactory->create($containerBuilder);
     $this->containerConfigCache->write($dumper->dump(), $containerBuilder->getResources());
 }
 /**
  * @param ContainerBuilder $containerBuilder
  */
 public function dump(ContainerBuilder $containerBuilder)
 {
     $dumper = $this->dumperFactory->create($containerBuilder);
     $this->filesystem->dumpFile($this->containerFilePath, $dumper->dump());
 }