Add tests for ticket validity and event date formatting
- Create TicketValiditySchemaTest to verify database schema for ticket validity. - Update CatalogModelsTest to include tests for event date attributes and selection options. - Introduce EventDateTextFormatterTest for formatting event dates in Spanish. - Refactor EventModelsTest to include validity time relationships. - Add SaleDetailResourceTest to ensure correct serialization of purchase items. - Enhance TicketTest with validity time checks and status management. - Implement ValidityTimeResourceTest to validate resource output for different validity types. - Add ValidityTimeTest to verify casting and validity checks for validity time types.
This commit is contained in:
@@ -6,7 +6,9 @@ use App\Domains\Attachable\Enums\AttachmentType;
|
||||
use App\Domains\Attachable\Models\Attachment;
|
||||
use App\Domains\Auth\Models\User;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticket\Enums\ValidityTimeType;
|
||||
use App\Domains\Ticket\Models\Ticket;
|
||||
use App\Domains\Ticket\Models\ValidityTime;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
@@ -21,6 +23,22 @@ class TicketControllerTest extends TestCase
|
||||
$user = User::factory()->create();
|
||||
$olderTicket = $this->createTicket($tenant, $user, 'Older ticket');
|
||||
$newerTicket = $this->createTicket($tenant, $user, 'Newer ticket');
|
||||
$validityTimes = collect([
|
||||
ValidityTime::query()->create([
|
||||
'type' => ValidityTimeType::FixedWindow,
|
||||
'fixed_starts_at' => now()->subHour(),
|
||||
'fixed_expires_at' => now()->addHour(),
|
||||
]),
|
||||
ValidityTime::query()->create([
|
||||
'type' => ValidityTimeType::FixedWindow,
|
||||
'fixed_starts_at' => now()->addDay(),
|
||||
'fixed_expires_at' => now()->addDays(2),
|
||||
]),
|
||||
]);
|
||||
$validityTimes->each(function (ValidityTime $validityTime) use ($newerTicket): void {
|
||||
$group = $newerTicket->validityGroups()->create();
|
||||
$group->validityTimes()->attach($validityTime);
|
||||
});
|
||||
|
||||
$this->actingAs($user, 'sanctum')
|
||||
->getJson("/api/tenants/{$tenant->codigo}/tickets")
|
||||
@@ -31,6 +49,10 @@ class TicketControllerTest extends TestCase
|
||||
->assertJsonPath('data.0.is_valid', true)
|
||||
->assertJsonPath('data.0.is_expired', false)
|
||||
->assertJsonPath('data.0.is_used', false)
|
||||
->assertJsonCount(2, 'data.0.validity_times')
|
||||
->assertJsonCount(2, 'data.0.validity_groups')
|
||||
->assertJsonCount(1, 'data.0.validity_groups.0.validity_times')
|
||||
->assertJsonMissingPath('data.0.validity_time')
|
||||
->assertJsonPath('data.1.id', $olderTicket->id)
|
||||
->assertJsonMissingPath('meta')
|
||||
->assertJsonMissingPath('links');
|
||||
|
||||
@@ -6,12 +6,18 @@ use App\Domains\Attachable\Enums\AttachmentType;
|
||||
use App\Domains\Attachable\Models\Attachment;
|
||||
use App\Domains\Auth\Models\User;
|
||||
use App\Domains\Catalog\Enums\CatalogItemType;
|
||||
use App\Domains\Catalog\Models\Attribute;
|
||||
use App\Domains\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Catalog\Models\Inventory;
|
||||
use App\Domains\Event\Models\EventDate;
|
||||
use App\Domains\Notification\Events\TicketsAvailable;
|
||||
use App\Domains\Purchase\Models\Purchase;
|
||||
use App\Domains\Shared\Enums\FieldType;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticket\Enums\TicketGenerationPolicy;
|
||||
use App\Domains\Ticket\Enums\ValidityTimeType;
|
||||
use App\Domains\Ticket\Exceptions\TicketGenerationException;
|
||||
use App\Domains\Ticket\Models\ValidityTime;
|
||||
use App\Domains\Ticket\Services\TicketGeneratorService;
|
||||
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
@@ -51,11 +57,7 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
|
||||
public function test_it_generates_tickets_from_a_standard_catalog_item(): void
|
||||
{
|
||||
$item = $this->createTicketableItem(
|
||||
'single-day',
|
||||
now()->subHour(),
|
||||
now()->addDay(),
|
||||
);
|
||||
$item = $this->createTicketableItem('single-day');
|
||||
|
||||
$tickets = $this->service->generate($item, $this->user, 2);
|
||||
|
||||
@@ -68,8 +70,7 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
$this->assertSame($item->descripcion, $ticket->description);
|
||||
$this->assertSame($item->id, $ticket->source_catalog_item_id);
|
||||
$this->assertNull($ticket->source_variant_id);
|
||||
$this->assertTrue($ticket->starts_at->equalTo($item->minimum_use_date));
|
||||
$this->assertTrue($ticket->expires_at->equalTo($item->maximum_use_date));
|
||||
$this->assertTrue($ticket->validityGroups->isEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,41 +85,56 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
$this->service->generate($item->fresh(), $this->user);
|
||||
}
|
||||
|
||||
public function test_it_generates_a_ticket_when_its_maximum_use_date_was_reached(): void
|
||||
public function test_variant_properties_are_appended_to_the_ticket_name(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('expired', maximumUseDate: now());
|
||||
|
||||
$tickets = $this->service->generate($item, $this->user);
|
||||
|
||||
$this->assertCount(1, $tickets);
|
||||
$this->assertTrue($tickets->first()->expires_at->equalTo($item->maximum_use_date));
|
||||
}
|
||||
|
||||
public function test_variant_dates_override_and_inherit_catalog_item_dates(): void
|
||||
{
|
||||
$item = $this->createTicketableItem(
|
||||
'variant-dates',
|
||||
now()->subDay(),
|
||||
now()->addMonth(),
|
||||
);
|
||||
$inventory = Inventory::query()->create();
|
||||
$item = $this->createTicketableItem('shirt');
|
||||
$color = Attribute::query()->create([
|
||||
'tenant_codigo' => $this->tenant->codigo,
|
||||
'codigo' => 'color',
|
||||
'nombre' => 'Color',
|
||||
'type' => FieldType::Select,
|
||||
]);
|
||||
$color->options()->create([
|
||||
'value' => 'black',
|
||||
'label' => 'Negro',
|
||||
]);
|
||||
$size = Attribute::query()->create([
|
||||
'tenant_codigo' => $this->tenant->codigo,
|
||||
'codigo' => 'size',
|
||||
'nombre' => 'Talle',
|
||||
'type' => FieldType::Select,
|
||||
]);
|
||||
$size->options()->create([
|
||||
'value' => 'xl',
|
||||
'label' => 'XL',
|
||||
]);
|
||||
$itemColor = $item->itemAttributes()->create([
|
||||
'attribute_id' => $color->id,
|
||||
'sort_order' => 1,
|
||||
]);
|
||||
$itemSize = $item->itemAttributes()->create([
|
||||
'attribute_id' => $size->id,
|
||||
'sort_order' => 2,
|
||||
]);
|
||||
$variant = $item->variants()->create([
|
||||
'inventory_id' => $inventory->id,
|
||||
'maximum_use_date' => now()->addWeek(),
|
||||
'inventory_id' => Inventory::query()->create()->id,
|
||||
]);
|
||||
$variant->definitions()->createMany([
|
||||
['item_attribute_id' => $itemColor->id, 'value' => 'black'],
|
||||
['item_attribute_id' => $itemSize->id, 'value' => 'xl'],
|
||||
]);
|
||||
|
||||
$ticket = $this->service
|
||||
->generate($item, $this->user, sourceVariantId: $variant->id)
|
||||
->firstOrFail();
|
||||
->generate($item, $this->user, 1, $variant->id)
|
||||
->sole();
|
||||
|
||||
$this->assertTrue($ticket->starts_at->equalTo($item->minimum_use_date));
|
||||
$this->assertTrue($ticket->expires_at->equalTo($variant->maximum_use_date));
|
||||
$this->assertSame('Shirt (Negro, XL)', $ticket->name);
|
||||
}
|
||||
|
||||
public function test_it_generates_tickets_for_every_bundle_component_and_quantity(): void
|
||||
{
|
||||
$first = $this->createTicketableItem('first', maximumUseDate: now()->addDay());
|
||||
$second = $this->createTicketableItem('second', maximumUseDate: now()->addDays(2));
|
||||
$first = $this->createTicketableItem('first');
|
||||
$second = $this->createTicketableItem('second');
|
||||
$bundle = $this->createBundle('bundle');
|
||||
$bundle->bundleComponents()->createMany([
|
||||
['component_catalog_item_id' => $first->id, 'quantity' => 2],
|
||||
@@ -134,18 +150,12 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
$this->assertCount(2, $tickets->where('name', $second->nombre));
|
||||
}
|
||||
|
||||
public function test_bundle_component_uses_its_variant_dates(): void
|
||||
public function test_bundle_component_preserves_its_source_variant(): void
|
||||
{
|
||||
$component = $this->createTicketableItem(
|
||||
'variant-component',
|
||||
now()->subDay(),
|
||||
now()->addMonth(),
|
||||
);
|
||||
$component = $this->createTicketableItem('variant-component');
|
||||
$inventory = Inventory::query()->create();
|
||||
$variant = $component->variants()->create([
|
||||
'inventory_id' => $inventory->id,
|
||||
'minimum_use_date' => now()->addDay(),
|
||||
'maximum_use_date' => now()->addWeek(),
|
||||
]);
|
||||
$bundle = $this->createBundle('variant-bundle');
|
||||
$bundle->bundleComponents()->create([
|
||||
@@ -160,8 +170,6 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
|
||||
$this->assertSame($component->id, $ticket->source_catalog_item_id);
|
||||
$this->assertSame($variant->id, $ticket->source_variant_id);
|
||||
$this->assertTrue($ticket->starts_at->equalTo($variant->minimum_use_date));
|
||||
$this->assertTrue($ticket->expires_at->equalTo($variant->maximum_use_date));
|
||||
}
|
||||
|
||||
public function test_bundle_generation_is_rolled_back_when_a_component_is_invalid(): void
|
||||
@@ -224,6 +232,208 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_event_date_and_time_window_are_combined_in_the_same_and_group(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('scheduled-meal');
|
||||
$eventDate = EventDate::query()->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'date' => '2026-08-20',
|
||||
'time_start' => '09:00:00',
|
||||
'time_end' => '23:59:59',
|
||||
]);
|
||||
$timeWindow = ValidityTime::query()->create([
|
||||
'type' => ValidityTimeType::TimeWindow,
|
||||
'start_time' => '22:00:00',
|
||||
'end_time' => '02:00:00',
|
||||
]);
|
||||
$schedule = Attribute::query()->create([
|
||||
'tenant_codigo' => $this->tenant->codigo,
|
||||
'codigo' => 'schedule',
|
||||
'nombre' => 'Schedule',
|
||||
'type' => FieldType::Select,
|
||||
]);
|
||||
$schedule->options()->create([
|
||||
'value' => 'night',
|
||||
'label' => '22:00 - 02:00',
|
||||
'validity_time_id' => $timeWindow->id,
|
||||
]);
|
||||
$itemSchedule = $item->itemAttributes()->create([
|
||||
'attribute_id' => $schedule->id,
|
||||
]);
|
||||
$inventory = Inventory::query()->create();
|
||||
$variant = $item->variants()->create([
|
||||
'event_date_id' => $eventDate->id,
|
||||
'inventory_id' => $inventory->id,
|
||||
]);
|
||||
$variant->definitions()->create([
|
||||
'item_attribute_id' => $itemSchedule->id,
|
||||
'value' => 'night',
|
||||
]);
|
||||
|
||||
$tickets = $this->service->generate($item, $this->user, 2, $variant->id);
|
||||
|
||||
$this->assertCount(2, $tickets);
|
||||
$this->assertTrue($tickets->every(fn ($ticket): bool => $ticket->validityGroups->count() === 1));
|
||||
$this->assertTrue($tickets->every(
|
||||
fn ($ticket): bool => $ticket->validityGroups->sole()->validityTimes
|
||||
->pluck('id')
|
||||
->sort()
|
||||
->values()
|
||||
->all() === collect([$eventDate->validity_time_id, $timeWindow->id])->sort()->values()->all()
|
||||
));
|
||||
$this->assertSame(
|
||||
'2026-08-20 22:00:00',
|
||||
$tickets->first()->getEffectiveStartsAt()->format('Y-m-d H:i:s'),
|
||||
);
|
||||
$this->assertSame(
|
||||
'2026-08-20 23:59:59',
|
||||
$tickets->first()->getEffectiveExpiresAt()->format('Y-m-d H:i:s'),
|
||||
);
|
||||
}
|
||||
|
||||
public function test_a_multi_date_variant_generates_one_ticket_for_each_selected_date(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('multi-date-pass');
|
||||
$dates = collect(['2026-08-20', '2026-08-21'])->map(fn (string $date) => EventDate::query()->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'date' => $date,
|
||||
'time_start' => '00:00:00',
|
||||
'time_end' => '23:59:59',
|
||||
]));
|
||||
$variant = $item->variants()->create([
|
||||
'inventory_id' => Inventory::query()->create()->id,
|
||||
]);
|
||||
$variant->eventDates()->sync($dates->pluck('id'));
|
||||
|
||||
$tickets = $this->service->generate($item, $this->user, 1, $variant->id);
|
||||
$tickets->each->loadMissing('validityGroups.validityTimes');
|
||||
|
||||
$this->assertCount(2, $tickets);
|
||||
$this->assertSame(
|
||||
$dates->pluck('validity_time_id')->all(),
|
||||
$tickets->map(fn ($ticket): int => $ticket->validityGroups->sole()->validityTimes->sole()->id)->all(),
|
||||
);
|
||||
$this->assertSame(
|
||||
['2026-08-20 00:00:00', '2026-08-21 00:00:00'],
|
||||
$tickets->map(fn ($ticket): string => $ticket->validityGroups->sole()->validityTimes->sole()->fixed_starts_at->format('Y-m-d H:i:s'))->all(),
|
||||
);
|
||||
$this->assertSame(
|
||||
['Multi-date-pass (20/08/2026)', 'Multi-date-pass (21/08/2026)'],
|
||||
$tickets->pluck('name')->all(),
|
||||
);
|
||||
$this->assertSame([$variant->id], $tickets->pluck('source_variant_id')->unique()->values()->all());
|
||||
}
|
||||
|
||||
public function test_one_per_unit_policy_generates_one_ticket_covering_all_selected_dates(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('multi-date-pass');
|
||||
$item->update([
|
||||
'ticket_generation_policy' => TicketGenerationPolicy::OnePerUnit,
|
||||
]);
|
||||
$dates = collect(['2026-08-20', '2026-08-21'])->map(fn (string $date) => EventDate::query()->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'date' => $date,
|
||||
'time_start' => '00:00:00',
|
||||
'time_end' => '23:59:59',
|
||||
]));
|
||||
$variant = $item->variants()->create([
|
||||
'inventory_id' => Inventory::query()->create()->id,
|
||||
]);
|
||||
$variant->eventDates()->sync($dates->pluck('id'));
|
||||
|
||||
$tickets = $this->service->generate($item, $this->user, 2, $variant->id);
|
||||
$tickets->each->loadMissing('validityGroups.validityTimes');
|
||||
|
||||
$this->assertCount(2, $tickets);
|
||||
$this->assertTrue($tickets->every(fn ($ticket): bool => $ticket->validityGroups->count() === 2));
|
||||
$this->assertTrue($tickets->every(
|
||||
fn ($ticket): bool => $ticket->validityGroups->every(
|
||||
fn ($group): bool => $group->validityTimes->count() === 1
|
||||
)
|
||||
));
|
||||
$this->assertEqualsCanonicalizing(
|
||||
$dates->pluck('validity_time_id')->all(),
|
||||
$tickets->flatMap(fn ($ticket) => $ticket->allValidityTimes())->pluck('id')->unique()->all(),
|
||||
);
|
||||
$this->assertTrue($tickets->every(
|
||||
fn ($ticket): bool => $ticket->name === 'Multi-date-pass (20/08/2026, 21/08/2026)'
|
||||
));
|
||||
$this->assertTrue($tickets->every(
|
||||
fn ($ticket): bool => $ticket->allValidityTimes()
|
||||
->map(fn (ValidityTime $validityTime): array => [
|
||||
$validityTime->fixed_starts_at->format('Y-m-d H:i:s'),
|
||||
$validityTime->fixed_expires_at->format('Y-m-d H:i:s'),
|
||||
])
|
||||
->all() === [
|
||||
['2026-08-20 00:00:00', '2026-08-20 23:59:59'],
|
||||
['2026-08-21 00:00:00', '2026-08-21 23:59:59'],
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
public function test_common_schedule_is_anded_into_each_alternative_event_date_group(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('multi-date-lunch');
|
||||
$item->update(['ticket_generation_policy' => TicketGenerationPolicy::OnePerUnit]);
|
||||
$dates = collect(['2026-08-20', '2026-08-21'])->map(fn (string $date) => EventDate::query()->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'date' => $date,
|
||||
'time_start' => '09:00:00',
|
||||
'time_end' => '18:00:00',
|
||||
]));
|
||||
$lunch = ValidityTime::query()->create([
|
||||
'type' => ValidityTimeType::TimeWindow,
|
||||
'start_time' => '12:00:00',
|
||||
'end_time' => '15:00:00',
|
||||
]);
|
||||
$schedule = Attribute::query()->create([
|
||||
'tenant_codigo' => $this->tenant->codigo,
|
||||
'codigo' => 'schedule',
|
||||
'nombre' => 'Schedule',
|
||||
'type' => FieldType::Select,
|
||||
]);
|
||||
$schedule->options()->create([
|
||||
'value' => 'lunch',
|
||||
'label' => 'Lunch',
|
||||
'validity_time_id' => $lunch->id,
|
||||
]);
|
||||
$itemSchedule = $item->itemAttributes()->create(['attribute_id' => $schedule->id]);
|
||||
$variant = $item->variants()->create([
|
||||
'inventory_id' => Inventory::query()->create()->id,
|
||||
]);
|
||||
$variant->eventDates()->sync($dates->pluck('id'));
|
||||
$variant->definitions()->create([
|
||||
'item_attribute_id' => $itemSchedule->id,
|
||||
'value' => 'lunch',
|
||||
]);
|
||||
|
||||
$ticket = $this->service->generate($item, $this->user, 1, $variant->id)->sole();
|
||||
$ticket->loadMissing('validityGroups.validityTimes');
|
||||
|
||||
$this->assertCount(2, $ticket->validityGroups);
|
||||
$this->assertTrue($ticket->validityGroups->every(
|
||||
fn ($group): bool => $group->validityTimes->count() === 2
|
||||
&& $group->validityTimes->contains($lunch)
|
||||
));
|
||||
$this->assertEqualsCanonicalizing(
|
||||
$dates->pluck('validity_time_id')->all(),
|
||||
$ticket->validityGroups
|
||||
->flatMap->validityTimes
|
||||
->reject(fn (ValidityTime $validityTime): bool => $validityTime->is($lunch))
|
||||
->pluck('id')
|
||||
->all(),
|
||||
);
|
||||
$this->assertSame('2026-08-20 12:00:00', $ticket->getEffectiveStartsAt()->format('Y-m-d H:i:s'));
|
||||
$this->assertSame('2026-08-21 15:00:00', $ticket->getEffectiveExpiresAt()->format('Y-m-d H:i:s'));
|
||||
|
||||
Carbon::setTestNow('2026-08-20 13:00:00');
|
||||
$this->assertTrue($ticket->isValid());
|
||||
|
||||
Carbon::setTestNow('2026-08-20 16:00:00');
|
||||
$this->assertFalse($ticket->isValid());
|
||||
$this->assertFalse($ticket->is_expired);
|
||||
}
|
||||
|
||||
public function test_marking_a_purchase_as_paid_ignores_items_without_tickets(): void
|
||||
{
|
||||
Event::fake([TicketsAvailable::class]);
|
||||
@@ -244,9 +454,9 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
->assertJsonPath('data.has_generated_tickets', false);
|
||||
}
|
||||
|
||||
public function test_paid_status_is_confirmed_when_ticket_maximum_use_date_was_reached(): void
|
||||
public function test_paid_status_is_confirmed_when_ticket_is_generated(): void
|
||||
{
|
||||
$item = $this->createTicketableItem('expired-paid-ticket', maximumUseDate: now());
|
||||
$item = $this->createTicketableItem('paid-ticket');
|
||||
$purchase = $this->createPurchase($item, 1);
|
||||
|
||||
$purchase->markAsPaid();
|
||||
@@ -258,11 +468,8 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
private function createTicketableItem(
|
||||
string $slug,
|
||||
mixed $minimumUseDate = null,
|
||||
mixed $maximumUseDate = null,
|
||||
): CatalogItem {
|
||||
private function createTicketableItem(string $slug): CatalogItem
|
||||
{
|
||||
return CatalogItem::query()->create([
|
||||
'tenant_code' => $this->tenant->codigo,
|
||||
'slug' => $slug,
|
||||
@@ -270,8 +477,6 @@ class TicketGeneratorServiceTest extends TestCase
|
||||
'descripcion' => "Descripción de {$slug}",
|
||||
'precio' => 10,
|
||||
'has_tickets' => true,
|
||||
'minimum_use_date' => $minimumUseDate,
|
||||
'maximum_use_date' => $maximumUseDate,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
49
tests/Feature/Ticket/TicketValiditySchemaTest.php
Normal file
49
tests/Feature/Ticket/TicketValiditySchemaTest.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Ticket;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Tests\TestCase;
|
||||
|
||||
class TicketValiditySchemaTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_ticket_validity_time_schema_is_available(): void
|
||||
{
|
||||
$this->assertEqualsCanonicalizing([
|
||||
'id',
|
||||
'type',
|
||||
'start_time',
|
||||
'end_time',
|
||||
'fixed_starts_at',
|
||||
'fixed_expires_at',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
], Schema::getColumnListing('validity_times'));
|
||||
|
||||
$this->assertFalse(Schema::hasColumn('tickets', 'validity_time_id'));
|
||||
$this->assertFalse(Schema::hasTable('ticket_validity_times'));
|
||||
$this->assertEqualsCanonicalizing([
|
||||
'id',
|
||||
'ticket_id',
|
||||
], Schema::getColumnListing('ticket_validity_groups'));
|
||||
$this->assertEqualsCanonicalizing([
|
||||
'ticket_validity_group_id',
|
||||
'validity_time_id',
|
||||
], Schema::getColumnListing('ticket_validity_group_times'));
|
||||
$this->assertFalse(Schema::hasColumn('tickets', 'service_date'));
|
||||
$this->assertFalse(Schema::hasColumn('tickets', 'starts_at'));
|
||||
$this->assertFalse(Schema::hasColumn('tickets', 'expires_at'));
|
||||
|
||||
$this->assertTrue(Schema::hasColumn('catalog_items', 'validity_time_id'));
|
||||
$this->assertFalse(Schema::hasColumn('catalog_items', 'minimum_use_date'));
|
||||
$this->assertFalse(Schema::hasColumn('catalog_items', 'maximum_use_date'));
|
||||
$this->assertTrue(Schema::hasColumn('attribute_options', 'validity_time_id'));
|
||||
$this->assertTrue(Schema::hasColumn('event_dates', 'validity_time_id'));
|
||||
$this->assertFalse(Schema::hasColumn('variantes', 'minimum_use_date'));
|
||||
$this->assertFalse(Schema::hasColumn('variantes', 'maximum_use_date'));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user