Prueba de integracion para service worker
This commit is contained in:
36
app/tests/integration/QueueTest.php
Normal file
36
app/tests/integration/QueueTest.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user