Files
saasshop/tests/Feature/AdminSiteSubscriptionExportDownloadSafetyValveTest.php

34 lines
820 B
PHP

<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionExportDownloadSafetyValveTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_export_should_require_download_flag(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/site-subscriptions/export')
->assertStatus(400)
->assertSee('download=1 required');
$this->get('/admin/site-subscriptions/export?download=1')
->assertOk();
}
}