public function testLoadShipmentId()
 {
     $shipmentModelMock = $this->getMockBuilder('Magento\\Sales\\Model\\Order\\Shipment')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->shipmentRepositoryMock->expects($this->once())->method('get')->with($this->loader->getShipmentId())->willReturn($shipmentModelMock);
     $this->registryMock->expects($this->once())->method('register')->with('current_shipment', $shipmentModelMock);
     $this->assertEquals($shipmentModelMock, $this->loader->load());
 }
Exemple #2
0
 /**
  * test shipment list service
  */
 public function testInvoke()
 {
     $this->shipmentRepositoryMock->expects($this->once())->method('find')->with($this->equalTo($this->searchCriteriaMock))->will($this->returnValue([$this->shipmentMock]));
     $this->shipmentMapperMock->expects($this->once())->method('extractDto')->with($this->equalTo($this->shipmentMock))->will($this->returnValue($this->dataObjectMock));
     $this->searchResultsBuilderMock->expects($this->once())->method('setItems')->with($this->equalTo([$this->dataObjectMock]))->will($this->returnSelf());
     $this->searchResultsBuilderMock->expects($this->once())->method('setTotalCount')->with($this->equalTo(count($this->shipmentMock)))->will($this->returnSelf());
     $this->searchResultsBuilderMock->expects($this->once())->method('setSearchCriteria')->with($this->equalTo($this->searchCriteriaMock))->will($this->returnSelf());
     $this->searchResultsBuilderMock->expects($this->once())->method('create')->will($this->returnValue('expected-result'));
     $this->assertEquals('expected-result', $this->shipmentList->invoke($this->searchCriteriaMock));
 }
Exemple #3
0
 /**
  * test shipment get service
  */
 public function testInvoke()
 {
     $this->shipmentRepositoryMock->expects($this->once())->method('get')->with($this->equalTo(1))->will($this->returnValue($this->shipmentMock));
     $this->shipmentMapperMock->expects($this->once())->method('extractDto')->with($this->equalTo($this->shipmentMock))->will($this->returnValue($this->dataObjectMock));
     $this->assertEquals($this->dataObjectMock, $this->shipmentGet->invoke(1));
 }
Exemple #4
0
 /**
  * test shipment label get service
  */
 public function testInvoke()
 {
     $this->shipmentRepositoryMock->expects($this->once())->method('get')->with($this->equalTo(1))->will($this->returnValue($this->shipmentMock));
     $this->shipmentMock->expects($this->once())->method('getShippingLabel')->will($this->returnValue('shipping_label'));
     $this->assertEquals('shipping_label', $this->shipmentLabelGet->invoke(1));
 }