/** * @test */ public function shouldDoMasspayRequestIfModelNotAcknowledge() { $payoutModel = new \ArrayObject(['bar' => 'barVal']); $gatewayMock = $this->createGatewayMock(); $gatewayMock->expects($this->once())->method('execute')->with($this->isInstanceOf(Masspay::class))->will($this->returnCallback(function (Masspay $request) { $model = $request->getModel(); $model['foo'] = 'fooVal'; })); $action = new PayoutAction(); $action->setGateway($gatewayMock); $action->execute(new Payout($payoutModel)); $this->assertEquals(['foo' => 'fooVal', 'bar' => 'barVal'], (array) $payoutModel); }