increase test coverage (#117)

70% test coverage
remove socialite
This commit is contained in:
Saeed Vaziry
2024-03-15 22:23:45 +01:00
committed by GitHub
parent 4f12de9586
commit a406491160
62 changed files with 1102 additions and 639 deletions

View File

@ -3,6 +3,7 @@
namespace Tests;
use App\Enums\Database;
use App\Enums\NotificationChannel;
use App\Enums\ServiceStatus;
use App\Enums\Webserver;
use App\Models\Server;
@ -31,6 +32,14 @@ public function setUp(): void
$this->user = User::factory()->create();
\App\Models\NotificationChannel::factory()->create([
'provider' => NotificationChannel::EMAIL,
'connected' => true,
'data' => [
'email' => 'user@example.com',
],
]);
$this->setupServer();
$this->setupSite();
@ -38,6 +47,15 @@ public function setUp(): void
$this->setupKeys();
}
public function tearDown(): void
{
parent::tearDown();
if (File::exists(storage_path('app/key-pairs-test'))) {
File::deleteDirectory(storage_path('app/key-pairs-test'));
}
}
private function setupServer(): void
{
$this->server = Server::factory()->create([