Initial PHP rebuild of the app
This commit is contained in:
690 files changed
+33944
-12046
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\ApplicationInstallation;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class InstallationTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_a_clean_database_can_be_installed_once(): void
|
||||
{
|
||||
$this->get('/install')->assertOk()->assertSee('Create your business');
|
||||
|
||||
$response = $this->post('/install', [
|
||||
'businessName' => 'Installed Shop',
|
||||
'slug' => 'installed-shop',
|
||||
'domain' => 'localhost',
|
||||
'adminName' => 'First Owner',
|
||||
'adminEmail' => 'first-owner@example.test',
|
||||
'password' => 'password123',
|
||||
'password_confirmation' => 'password123',
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('install'));
|
||||
$this->assertDatabaseHas('ApplicationInstallation', ['id' => 'singleton', 'status' => 'INSTALLED']);
|
||||
$this->assertDatabaseHas('Business', ['slug' => 'installed-shop']);
|
||||
$this->assertDatabaseHas('User', ['email' => 'first-owner@example.test']);
|
||||
$this->get('/install')->assertRedirect(route('public.home'));
|
||||
$this->assertSame(1, ApplicationInstallation::count());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user