コード例 #1
0
ファイル: RelationTest.php プロジェクト: nja78/magento2
 public function testProcessRelations()
 {
     $this->shipmentMock->expects($this->once())->method('getId')->willReturn('shipment-id-value');
     $this->shipmentMock->expects($this->exactly(2))->method('getItems')->willReturn([$this->itemMock]);
     $this->shipmentMock->expects($this->exactly(2))->method('getComments')->willReturn([$this->commentMock]);
     $this->shipmentMock->expects($this->exactly(2))->method('getTracks')->willReturn([$this->trackMock]);
     $this->itemMock->expects($this->once())->method('setParentId')->with('shipment-id-value')->willReturnSelf();
     $this->itemResourceMock->expects($this->once())->method('save')->with($this->itemMock)->willReturnSelf();
     $this->commentResourceMock->expects($this->once())->method('save')->with($this->commentMock)->willReturnSelf();
     $this->trackResourceMock->expects($this->once())->method('save')->with($this->trackMock)->willReturnSelf();
     $this->relationProcessor->processRelation($this->shipmentMock);
 }