Ejemplo n.º 1
0
 /**
  * @param Payment $payment
  */
 public function __construct(Payment $payment)
 {
     if (!$payment->isValid()) {
         throw new \InvalidArgumentException("Payment is not valid");
     }
     $this->payment = $payment;
 }
Ejemplo n.º 2
0
 public function testValidity()
 {
     $payment = new Payment();
     $payment->setValue(10);
     $this->assertTrue($payment->isValid());
 }