Ejemplo n.º 1
0
 function it_should_be_possible_to_contruct_it_with_references_as_arguments(ReferenceInterface $one, ReferenceInterface $two, ReferenceInterface $three)
 {
     $one->getId()->shouldNotBeCalled();
     $two->getId()->shouldNotBeCalled();
     $three->getId()->shouldNotBeCalled();
     $this->beConstructedWith(['one' => $one, 'two' => $two, 'three' => $three]);
     $this->get('one')->shouldReturn($one);
     $this->get('two')->shouldReturn($two);
     $this->get('three')->shouldReturn($three);
 }
Ejemplo n.º 2
0
 /**
  * Returns dispersed reference file path
  *
  * @param ReferenceInterface $reference
  * @param null|string $dispersion
  *
  * @return string
  */
 private function getReferenceFilePath(ReferenceInterface $reference, $dispersion = null)
 {
     if ($dispersion === null) {
         $dispersion = $this->dispersion->calculate($reference->getId());
     }
     return sprintf('%s/%s/%s.php', $this->filePath, $dispersion, $reference->getId());
 }