| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace Webkul\BagistoApi\Tests\Unit\Migration;
- use Illuminate\Support\Facades\Schema;
- use Webkul\BagistoApi\Tests\BagistoApiTestCase;
- use Webkul\Customer\Models\Customer;
- class ResetCustomersCommandTest extends BagistoApiTestCase
- {
- public function setUp(): void
- {
- parent::setUp();
- if (! Schema::hasTable('customers') || ! Schema::hasTable('customer_groups')) {
- $this->markTestSkipped('Customer tables are missing.');
- }
- $this->seedRequiredData();
- }
- public function test_dry_run_does_not_delete_customers(): void
- {
- $customer = $this->createCustomer();
- $this->artisan('customers:reset', ['--dry-run' => true])
- ->assertSuccessful();
- $this->assertDatabaseHas('customers', ['id' => $customer->id]);
- }
- }
|