Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function generate(SequenceSubjectInterface $subject, SequenceInterface $sequence)
 {
     if (null !== $subject->getNumber()) {
         return;
     }
     $subject->setNumber($this->generateNumber($sequence->getIndex(), $subject));
     $sequence->incrementIndex();
 }
Ejemplo n.º 2
0
 function it_starts_at_start_number_if_specified(SequenceSubjectInterface $subject, SequenceInterface $sequence)
 {
     $this->beConstructedWith(6, 123);
     $subject->getNumber()->willReturn(null);
     $subject->getSequenceType()->willReturn('order');
     $sequence->getIndex()->willReturn(0);
     $sequence->incrementIndex()->shouldBeCalled();
     $subject->setNumber('000123')->shouldBeCalled();
     $this->generate($subject, $sequence);
 }