예제 #1
0
 /**
  * @dataProvider payDataProvider
  * @param float $orderTotalPaid
  * @param float $orderBaseTotalPaid
  * @param float $grandTotal
  * @param float $baseGrandTotal
  * @param float $expectedState
  */
 public function testPay($orderTotalPaid, $orderBaseTotalPaid, $grandTotal, $baseGrandTotal, $expectedState)
 {
     $this->mockPay();
     $this->model->setGrandTotal($grandTotal);
     $this->model->setBaseGrandTotal($baseGrandTotal);
     $this->orderMock->setTotalPaid($orderTotalPaid);
     $this->orderMock->setBaseTotalPaid($orderBaseTotalPaid);
     $this->assertFalse($this->model->wasPayCalled());
     $this->assertEquals($this->model, $this->model->pay());
     $this->assertTrue($this->model->wasPayCalled());
     $this->assertEquals($expectedState, $this->model->getState());
     #second call of pay() method must do nothing
     $this->model->pay();
 }