Пример #1
0
 function let(CacheKey\ConverterInterface $converter, CacheKey\NormalizerInterface $normalizer)
 {
     $this->converter = $converter;
     $this->normalizer = $normalizer;
     $this->beConstructedWith($this->normalizer, $this->converter);
     $this->normalizer->normalize(Argument::type('string'))->willReturnArgument(0);
 }
Пример #2
0
 function it_calls_all_normalizers_in_chain(NormalizerInterface $first, NormalizerInterface $second, NormalizerInterface $third)
 {
     $first->normalize('some_specific_value')->willReturn('first_specific_value')->shouldBeCalled();
     $second->normalize('first_specific_value')->willReturn('second_specific_value')->shouldBeCalled();
     $third->normalize('second_specific_value')->willReturn('third_specific_value')->shouldBeCalled();
     $this->beConstructedWith([$first, $second, $third]);
     $this->normalize('some_specific_value')->shouldReturn('third_specific_value');
 }