/** * test for Order::cancel() */ public function testCancel() { $this->orderRepositoryMock->expects($this->once())->method('get')->with(123)->willReturn($this->orderMock); $this->orderMock->expects($this->once())->method('cancel')->willReturn($this->orderMock); $this->assertTrue($this->orderService->cancel(123)); }