Beispiel #1
0
 /**
  * Test purge method
  */
 public function testPurge()
 {
     $this->appResourceMock->expects($this->once())->method('getConnection')->will($this->returnValue($this->adapterMock));
     $this->appResourceMock->expects($this->once())->method('getTableName')->will($this->returnValue('sales_invoice_grid'));
     $this->adapterMock->expects($this->once())->method('delete')->with('sales_invoice_grid', ['fi.field = ?' => 1])->will($this->returnValue(1));
     $this->assertEquals(1, $this->grid->purge(1, 'fi.field'));
 }
Beispiel #2
0
 /**
  * Test method refreshByOrderId()
  */
 public function testRefreshByOrderId()
 {
     $orderId = 1;
     $this->orderGridMock->expects($this->once())->method('refresh')->with($this->equalTo($orderId), $this->equalTo('sfo.entity_id'))->will($this->returnValue($this->statementMock));
     $this->invoiceGridMock->expects($this->once())->method('refresh')->with($this->equalTo($orderId), $this->equalTo('sfo.entity_id'))->will($this->returnValue($this->statementMock));
     $this->shipmentGridMock->expects($this->once())->method('refresh')->with($this->equalTo($orderId), $this->equalTo('sfo.entity_id'))->will($this->returnValue($this->statementMock));
     $this->creditmemoGridMock->expects($this->once())->method('refresh')->with($this->equalTo($orderId), $this->equalTo('sfo.entity_id'))->will($this->returnValue($this->statementMock));
     $this->assertEquals($this->gridPool, $this->gridPool->refreshByOrderId($orderId));
 }