Ejemplo n.º 1
0
 function it_should_throw_exception_when_adding_tape_with_duplicated_name(Tape $tape)
 {
     $this->beConstructedWith(__DIR__, $this->getConfigFile());
     $tape->getName()->willReturn('my_tape');
     $this->shouldThrow('Ikwattro\\GuzzleStereo\\Exception\\RecorderException')->duringAddTape($tape);
 }
Ejemplo n.º 2
0
 /**
  * Process configuration for registering tapes and filters.
  */
 private function processConfig()
 {
     $processor = new Processor();
     $coreConfig = Yaml::parse(file_get_contents(__DIR__ . '/Resources/core_filters.yml'));
     $configs = array($this->config, $coreConfig);
     $configuration = new StereoConfiguration();
     $processedConfiguration = $processor->processConfiguration($configuration, $configs);
     foreach ($processedConfiguration['core_filters'] as $filterClass) {
         $this->mixer->addFilter($filterClass);
     }
     foreach ($processedConfiguration['custom_filters'] as $customFilterClass) {
         $this->mixer->addFilter($customFilterClass);
     }
     foreach ($processedConfiguration['tapes'] as $name => $settings) {
         $tape = new Tape($name);
         foreach ($settings['filters'] as $k => $args) {
             $filter = $this->mixer->createFilter($k, $args);
             $tape->addFilter($filter);
         }
         $this->addTape($tape);
     }
 }