getMockBuilder(Service\Venta\Pago::class)->disableOriginalConstructor()->getMock(); $pagoService->method('updateUF')->willReturn(true); $this->logger = $this->getMockBuilder(LoggerInterface::class)->disableOriginalConstructor()->getMock(); $this->container = $this->getMockBuilder(ContainerInterface::class)->disableOriginalConstructor()->getMock(); $this->container->method('get')->willReturnMap([ [LoggerInterface::class, $this->logger], [Service\Queue::class, $this->getMockBuilder(Service\Queue::class)->disableOriginalConstructor()->getMock()], [Service\UF::class, $this->getMockBuilder(Service\UF::class)->disableOriginalConstructor()->getMock()], [Service\Venta\Pago::class, $pagoService], ]); } public function testExecute(): void { $configuration = [ 'type' => 'service', 'service' => Service\Venta\Pago::class, 'method' => 'updateUF', 'params' => ['pago_id' => 1] ]; $job = $this->getMockBuilder(Model\Job::class)->disableOriginalConstructor()->getMock(); $job->configuration = $configuration; $service = new Service\Worker\Service($this->container, $this->logger); $result = $service->execute($job); $this->assertTrue($result); } }