Example #1
0
 public function testInvoke()
 {
     $status = 'pending';
     $id = 1;
     $orderMock = $this->getMock('Magento\\Sales\\Model\\Order', ['getStatus'], [], '', false);
     $orderMock->expects($this->once())->method('getStatus')->will($this->returnValue($status));
     $this->orderRepositoryMock->expects($this->once())->method('get')->with($this->equalTo($id))->will($this->returnValue($orderMock));
     $this->assertEquals($status, $this->service->invoke($id));
 }
Example #2
0
 /**
  * test order get status
  */
 public function testGetStatus()
 {
     $this->orderGetStatusMock->expects($this->once())->method('invoke')->with(1)->will($this->returnValue('search_result'));
     $this->assertEquals('search_result', $this->orderRead->getStatus(1));
 }
Example #3
0
 /**
  * @param int $id
  * @return string
  * @throws \Magento\Framework\Exception\NoSuchEntityException
  */
 public function getStatus($id)
 {
     return $this->orderGetStatus->invoke($id);
 }