Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function assignNumber(OrderInterface $order)
 {
     if (null !== $order->getNumber()) {
         return;
     }
     $order->setNumber($this->numberGenerator->generate($order));
 }
 function it_does_not_assign_a_number_to_an_order_with_number(OrderInterface $order, OrderNumberGeneratorInterface $numberGenerator)
 {
     $order->getNumber()->willReturn('00000007');
     $numberGenerator->generate($order)->shouldNotBeCalled();
     $order->setNumber(Argument::any())->shouldNotBeCalled();
     $this->assignNumber($order);
 }