/** * @cover ::createOperation */ public function testCreateOperatorOperation() { $this->operationManager->create(Argument::type('float'), Argument::type('DateTime'), Argument::type('string'), Argument::is(false))->will(function ($args) { list($amount, $cycleDate, $paymentVoucher, $miraklId) = $args; return new Operation($amount, $cycleDate, $paymentVoucher, $miraklId); })->shouldBeCalled(); $expectedOperation = new Operation(200, new DateTime(), "000001", false); $expectedOperation->setHipayId($this->operator->getHipayId()); $resultOperation = $this->cashoutInitializer->createOperation((double) 200, new DateTime(), "000001", false); $this->assertEquals($resultOperation->getHiPayId(), $this->operator->getHipayId()); $this->assertEquals($expectedOperation, $resultOperation); }