/** * @cover ::saveOperations * @cover ::areOperationValid */ public function testSaveOperation() { /** @var OperationInterface[] $callback */ $callback = Argument::that(function ($arg) { if (!is_array($arg)) { return false; } while ($value = next($arg)) { if (!$value instanceof OperationInterface) { return false; } } return true; }); $this->operationManager->saveAll($callback)->shouldBeCalled(); $this->operationManager->findByMiraklIdAndPaymentVoucherNumber(Argument::is(false), Argument::type("string"))->willReturn(null)->shouldBeCalled(); $this->operationManager->isValid($this->operationArgument)->willReturn(true)->shouldBeCalled(); $this->cashoutInitializer->saveOperations(array(new Operation(200, new DateTime(), "000001", false))); }