Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public function create(
$appendComment,
$comment->getIsVisibleOnFront()
);

if ($appendComment) {
$shipment->setCustomerNote($comment->getComment());
$shipment->setCustomerNoteNotify($appendComment);
}
}

return $shipment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function setUp()

$this->shipmentMock = $this->getMockBuilder(ShipmentInterface::class)
->disableOriginalConstructor()
->setMethods(['addComment', 'addTrack'])
->setMethods(['addComment', 'addTrack', 'setCustomerNote', 'setCustomerNoteNotify'])
->getMockForAbstractClass();

$this->hydratorPoolMock = $this->getMockBuilder(HydratorPool::class)
Expand Down Expand Up @@ -166,7 +166,7 @@ public function testCreate()
if ($appendComment) {
$comment = "New comment!";
$visibleOnFront = true;
$this->commentMock->expects($this->once())
$this->commentMock->expects($this->exactly(2))
->method('getComment')
->willReturn($comment);

Expand All @@ -178,6 +178,10 @@ public function testCreate()
->method('addComment')
->with($comment, $appendComment, $visibleOnFront)
->willReturnSelf();

$this->shipmentMock->expects($this->once())
->method('setCustomerNoteNotify')
->with(true);
}

$this->assertEquals(
Expand Down