mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-02 05:10:59 +00:00
27 lines
818 B
PHP
27 lines
818 B
PHP
<?php
|
|
|
|
use App\Models\Setting;
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
use Laravel\Sanctum\Sanctum;
|
|
|
|
use function Pest\Laravel\getJson;
|
|
|
|
beforeEach(function () {
|
|
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
|
|
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
|
|
|
|
$user = User::findOrFail(1);
|
|
$this->withHeaders(['company' => $user->companies()->firstOrFail()->id]);
|
|
Sanctum::actingAs($user, ['*']);
|
|
});
|
|
|
|
test('bootstrap does not expose the retired marketplace API token', function () {
|
|
Setting::setSetting('api_token', 'legacy-marketplace-token');
|
|
|
|
getJson('/api/v1/bootstrap')
|
|
->assertOk()
|
|
->assertJsonMissingPath('global_settings.api_token')
|
|
->assertDontSee('legacy-marketplace-token');
|
|
});
|