Files
oficial/app/tests/integration/QueueTest.php
2025-06-24 12:56:03 -04:00

36 lines
973 B
PHP

<?php
namespace Incoviba\Test\Integration;
use Psr\Container\ContainerInterface;
use PHPUnit\Framework\TestCase;
use Incoviba\Common\Implement;
use Incoviba\Common\Ideal;
use Incoviba\Service;
use Incoviba\Repository;
class QueueTest extends TestCase
{
protected ContainerInterface $container;
protected function setUp(): void
{
require_once implode(DIRECTORY_SEPARATOR, [dirname(__DIR__, 2), 'setup', 'container.php']);
$this->container = buildContainer();
}
public function testServiceWorker(): void
{
$pagoData = [
'fecha' => '2022-01-01',
'valor' => 10000,
];
$pagoService = $this->container->get(Service\Venta\Pago::class);
$pago = $pagoService->add($pagoData);
$queueService = $this->container->get(Service\Queue::class);
$queueService->run();
$pago = $pagoService->getById($pago->id);
$this->assertNotEquals(0.0, $pago->uf);
}
}