26 lines
670 B
PHP
26 lines
670 B
PHP
<?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'));
|
|
}
|
|
}
|