Пример #1
0
 /**
  * @dataProvider totalsDataProvider
  */
 public function testGetTotals($isVirtual)
 {
     $expected = 'expected';
     $this->quoteMock->expects($this->at(0))->method('setTotalsCollectedFlag')->with(false);
     $this->quoteMock->expects($this->at(1))->method('collectTotals');
     $this->quoteMock->expects($this->once())->method('isVirtual')->willreturn($isVirtual);
     if ($isVirtual) {
         $this->billingAddressMock->expects($this->once())->method('getTotals')->willReturn($expected);
     } else {
         $this->shippingAddressMock->expects($this->once())->method('getTotals')->willReturn($expected);
     }
     $this->assertEquals($expected, $this->totals->getTotals());
 }
Пример #2
0
 /**
  * @param mixed $customerNoteNotify
  * @param bool $expectedResult
  * @dataProvider getNoteNotifyDataProvider
  */
 public function testGetNoteNotify($customerNoteNotify, $expectedResult)
 {
     $this->quoteMock->expects($this->any())->method('getCustomerNoteNotify')->willReturn($customerNoteNotify);
     $this->assertEquals($expectedResult, $this->totals->getNoteNotify());
 }