feat: Add event association to purchases; implement event relationship in models, update migration, and enhance tests
This commit is contained in:
25
tests/Unit/Forms/SaleFormServiceTest.php
Normal file
25
tests/Unit/Forms/SaleFormServiceTest.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Forms;
|
||||
|
||||
use App\Domains\Forms\Services\SaleFormService;
|
||||
use App\Domains\Purchase\Models\Purchase;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SaleFormServiceTest extends TestCase
|
||||
{
|
||||
public function test_it_returns_every_purchase_status_as_a_form_option(): void
|
||||
{
|
||||
$form = (new SaleFormService)->get();
|
||||
|
||||
$this->assertSame(Purchase::statuses(), array_column($form['statuses'], 'code'));
|
||||
$this->assertSame([
|
||||
'Creada',
|
||||
'Esperando pago',
|
||||
'Confirmada',
|
||||
'Cancelada',
|
||||
'Rechazada',
|
||||
'Vencida',
|
||||
], array_column($form['statuses'], 'name'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user