Exemplo 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);
 }
Exemplo n.º 2
0
 /**
  * @param \Ikwattro\GuzzleStereo\Record\Tape $tape
  */
 public function addTape(Tape $tape)
 {
     if (array_key_exists($tape->getName(), $this->tapes)) {
         throw new RecorderException(sprintf('A tape with name %s is already registered', $tape->getName()));
     }
     $this->tapes[$tape->getName()] = $tape;
 }