39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Migrations;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Tests\TestCase;
|
|
|
|
class AddCartEditingEnabledToTenantsTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
public function test_it_disables_cart_editing_only_for_desfile(): void
|
|
{
|
|
$migration = require database_path(
|
|
'migrations/2026_08_18_060000_add_cart_editing_enabled_to_tenants_table.php'
|
|
);
|
|
|
|
$migration->down();
|
|
$migration->up();
|
|
|
|
$this->assertDatabaseHas('tenants', [
|
|
'codigo' => 'desfile_pura_tendencia',
|
|
'cart_editing_enabled' => false,
|
|
]);
|
|
|
|
DB::table('tenants')->insert([
|
|
'codigo' => 'cart-editing-default',
|
|
'nombre' => 'Cart editing default',
|
|
'dominio' => 'cart-editing-default.test',
|
|
]);
|
|
|
|
$this->assertDatabaseHas('tenants', [
|
|
'codigo' => 'cart-editing-default',
|
|
'cart_editing_enabled' => true,
|
|
]);
|
|
}
|
|
}
|