35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
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_admin_statuses_with_their_real_statuses(): void
|
|
{
|
|
$form = (new SaleFormService)->get();
|
|
|
|
$this->assertSame(Purchase::adminStatusCodes(), array_column($form['statuses'], 'value'));
|
|
$this->assertSame([
|
|
'Por completar datos',
|
|
'Esperando pago',
|
|
'Confirmado',
|
|
'Anulado',
|
|
], array_column($form['statuses'], 'label'));
|
|
$this->assertSame([
|
|
[Purchase::STATUS_CREATED],
|
|
[Purchase::STATUS_PENDING_PAYMENT, Purchase::STATUS_IN_REVIEW],
|
|
[Purchase::STATUS_PAID],
|
|
[
|
|
Purchase::STATUS_CANCELLED,
|
|
Purchase::STATUS_REJECTED,
|
|
Purchase::STATUS_EXPIRED,
|
|
Purchase::STATUS_SUPERSEDED,
|
|
],
|
|
], array_column($form['statuses'], 'real_statuses'));
|
|
}
|
|
}
|