feat(desfile): add entry reservation model
This commit is contained in:
23
tests/Feature/Desfile/EntryReservationSchemaTest.php
Normal file
23
tests/Feature/Desfile/EntryReservationSchemaTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Desfile;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EntryReservationSchemaTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_the_entry_reservations_table_has_the_requested_columns(): void
|
||||
{
|
||||
$this->assertTrue(Schema::hasColumns('desfile_entry_reservations', [
|
||||
'id',
|
||||
'variant_id',
|
||||
'fecha_reserva',
|
||||
'importe',
|
||||
'tipo_pago',
|
||||
]));
|
||||
}
|
||||
}
|
||||
30
tests/Unit/Desfile/EntryReservationTest.php
Normal file
30
tests/Unit/Desfile/EntryReservationTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Desfile;
|
||||
|
||||
use App\Domains\Ticketing\Desfile\Enums\EntryReservationPaymentType;
|
||||
use App\Domains\Ticketing\Desfile\Models\EntryReservation;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class EntryReservationTest extends TestCase
|
||||
{
|
||||
public function test_it_exposes_the_available_payment_types(): void
|
||||
{
|
||||
$this->assertSame([
|
||||
['value' => 'sin_cargo', 'label' => 'Sin cargo'],
|
||||
['value' => 'otro_metodo', 'label' => 'Otro método'],
|
||||
], EntryReservationPaymentType::options());
|
||||
}
|
||||
|
||||
public function test_it_defines_the_requested_fillable_fields(): void
|
||||
{
|
||||
$reservation = new EntryReservation;
|
||||
|
||||
$this->assertSame([
|
||||
'variant_id',
|
||||
'fecha_reserva',
|
||||
'importe',
|
||||
'tipo_pago',
|
||||
], $reservation->getFillable());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user