fix notification chanels and more tests (#108)

* fix notification chanels and more tests

* fix code style
This commit is contained in:
Saeed Vaziry 2024-02-16 21:10:17 +01:00 committed by GitHub
parent b75df8e1c5
commit f70963d6bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
103 changed files with 484 additions and 112 deletions

View File

@ -8,12 +8,12 @@
class Notifier class Notifier
{ {
/** /**
* In the future we can send notifications based on the notifiable instance * In the future we can send notifications based on the notifiable instance,
* For example, If it was a server then we will send the channels specified by that server * For example, If it was a server then we will send the channels specified by that server
* For now, we will send all channels. * For now, we will send all channels.
*/ */
public function send(object $notifiable, Notification $notification): void public function send(object $notifiable, Notification $notification): void
{ {
// NotificationChannel::notifyAll($notification); NotificationChannel::notifyAll($notification);
} }
} }

View File

@ -7,11 +7,6 @@
class Discord extends AbstractNotificationChannel class Discord extends AbstractNotificationChannel
{ {
public function channel(): string
{
return 'discord';
}
public function createRules(array $input): array public function createRules(array $input): array
{ {
return [ return [

View File

@ -35,7 +35,10 @@ public function connect(): bool
{ {
try { try {
Mail::to($this->data()['email'])->send( Mail::to($this->data()['email'])->send(
new NotificationMail('Test VitoDeploy', 'This is a test email!') new NotificationMail(
'Connected to VitoDeploy',
'This email confirms that you have connected your email to VitoDeploy.'
)
); );
} catch (Throwable) { } catch (Throwable) {
return false; return false;

View File

@ -7,11 +7,6 @@
class Slack extends AbstractNotificationChannel class Slack extends AbstractNotificationChannel
{ {
public function channel(): string
{
return 'slack';
}
public function createRules(array $input): array public function createRules(array $input): array
{ {
return [ return [

View File

@ -10,11 +10,6 @@ class Telegram extends AbstractNotificationChannel
{ {
protected string $apiUrl = 'https://api.telegram.org/bot'; protected string $apiUrl = 'https://api.telegram.org/bot';
public function channel(): string
{
return 'telegram';
}
public function createRules(array $input): array public function createRules(array $input): array
{ {
return [ return [

View File

@ -3,6 +3,7 @@
namespace App\Notifications; namespace App\Notifications;
use App\Contracts\Notification as NotificationInterface; use App\Contracts\Notification as NotificationInterface;
use App\Models\NotificationChannel;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Notifications\Messages\MailMessage;
@ -13,9 +14,16 @@ abstract class AbstractNotification extends Notification implements Notification
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
public function via(object $notifiable): string
{
/** @var NotificationChannel $notifiable */
return get_class($notifiable->provider());
}
public function toMail(object $notifiable): MailMessage public function toMail(object $notifiable): MailMessage
{ {
return (new MailMessage()) return (new MailMessage())
->subject('Notification')
->line($this->rawText()); ->line($this->rawText());
} }

View File

@ -91,7 +91,7 @@ public function install(): void
'server' => $this->server, 'server' => $this->server,
]) ])
); );
// Notifier::send($this->server, new ServerInstallationSucceed($this->server)); Notifier::send($this->server, new ServerInstallationSucceed($this->server));
}; };
Bus::chain($jobs) Bus::chain($jobs)

View File

@ -2,9 +2,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build"
"queue:listen": "php artisan queue:listen --timeout=600 --queue=default,ssh,ssh-long",
"scheduler:run": "php artisan schedule:run"
}, },
"devDependencies": { "devDependencies": {
"@ryangjchandler/alpine-clipboard": "^2.2.0", "@ryangjchandler/alpine-clipboard": "^2.2.0",

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\Application\AutoDeployment; use App\Http\Livewire\Application\AutoDeployment;
use App\Http\Livewire\Application\ChangeBranch; use App\Http\Livewire\Application\ChangeBranch;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http\Auth; namespace Tests\Feature\Auth;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http\Auth; namespace Tests\Feature\Auth;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http\Auth; namespace Tests\Feature\Auth;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use JsonException; use JsonException;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http\Auth; namespace Tests\Feature\Auth;
use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http\Auth; namespace Tests\Feature\Auth;
use App\Http\Livewire\Profile\UpdatePassword; use App\Http\Livewire\Profile\UpdatePassword;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\CronjobStatus; use App\Enums\CronjobStatus;
use App\Http\Livewire\Cronjobs\CreateCronjob; use App\Http\Livewire\Cronjobs\CreateCronjob;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\BackupStatus; use App\Enums\BackupStatus;
use App\Facades\SSH; use App\Facades\SSH;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\DatabaseStatus; use App\Enums\DatabaseStatus;
use App\Facades\SSH; use App\Facades\SSH;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\DatabaseUserStatus; use App\Enums\DatabaseUserStatus;
use App\Http\Livewire\Databases\DatabaseUserList; use App\Http\Livewire\Databases\DatabaseUserList;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\FirewallRuleStatus; use App\Enums\FirewallRuleStatus;
use App\Http\Livewire\Firewall\CreateFirewallRule; use App\Http\Livewire\Firewall\CreateFirewallRule;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\ServerLogs\LogsList; use App\Http\Livewire\ServerLogs\LogsList;
use App\Models\ServerLog; use App\Models\ServerLog;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\NotificationChannel; use App\Enums\NotificationChannel;
use App\Http\Livewire\NotificationChannels\AddChannel; use App\Http\Livewire\NotificationChannels\AddChannel;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\ServiceStatus; use App\Enums\ServiceStatus;
use App\Http\Livewire\Php\DefaultCli; use App\Http\Livewire\Php\DefaultCli;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\Profile\UpdatePassword; use App\Http\Livewire\Profile\UpdatePassword;
use App\Http\Livewire\Profile\UpdateProfileInformation; use App\Http\Livewire\Profile\UpdateProfileInformation;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\Projects\CreateProject; use App\Http\Livewire\Projects\CreateProject;
use App\Http\Livewire\Projects\EditProject; use App\Http\Livewire\Projects\EditProject;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\QueueStatus; use App\Enums\QueueStatus;
use App\Http\Livewire\Queues\CreateQueue; use App\Http\Livewire\Queues\CreateQueue;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\SshKeyStatus; use App\Enums\SshKeyStatus;
use App\Http\Livewire\ServerSshKeys\AddExistingKey; use App\Http\Livewire\ServerSshKeys\AddExistingKey;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\ServerProvider; use App\Enums\ServerProvider;
use App\Http\Livewire\ServerProviders\ConnectProvider; use App\Http\Livewire\ServerProviders\ConnectProvider;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\Database; use App\Enums\Database;
use App\Enums\OperatingSystem; use App\Enums\OperatingSystem;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\ServiceStatus; use App\Enums\ServiceStatus;
use App\Http\Livewire\Services\InstallPHPMyAdmin; use App\Http\Livewire\Services\InstallPHPMyAdmin;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\SiteStatus; use App\Enums\SiteStatus;
use App\Enums\SiteType; use App\Enums\SiteType;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\SourceControls\Connect; use App\Http\Livewire\SourceControls\Connect;
use App\Http\Livewire\SourceControls\SourceControlsList; use App\Http\Livewire\SourceControls\SourceControlsList;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Http\Livewire\SshKeys\AddKey; use App\Http\Livewire\SshKeys\AddKey;
use App\Http\Livewire\SshKeys\KeysList; use App\Http\Livewire\SshKeys\KeysList;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\SslStatus; use App\Enums\SslStatus;
use App\Enums\SslType; use App\Enums\SslType;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Http; namespace Tests\Feature;
use App\Enums\StorageProvider; use App\Enums\StorageProvider;
use App\Http\Livewire\StorageProviders\ConnectProvider; use App\Http\Livewire\StorageProviders\ConnectProvider;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\Models; namespace Tests\Unit\Models;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase; use Tests\TestCase;

View File

@ -0,0 +1,87 @@
<?php
namespace Tests\Unit\NotificationChannels;
use App\Models\NotificationChannel;
use App\NotificationChannels\Discord;
use Illuminate\Http\Client\Request;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class DiscordTest extends TestCase
{
public function test_create_rules(): void
{
$provider = new Discord(NotificationChannel::factory()->create([
'provider' => 'discord',
]));
$this->assertSame([
'webhook_url' => 'required|url',
], $provider->createRules([]));
}
public function test_create_data(): void
{
$provider = new Discord(NotificationChannel::factory()->create([
'provider' => 'discord',
]));
$this->assertSame([
'webhook_url' => 'https://discord.com/xxxxx',
], $provider->createData([
'webhook_url' => 'https://discord.com/xxxxx',
]));
}
public function test_data(): void
{
$provider = new Discord(NotificationChannel::factory()->create([
'provider' => 'discord',
'data' => [
'webhook_url' => 'https://discord.com/xxxxx',
],
]));
$this->assertSame([
'webhook_url' => 'https://discord.com/xxxxx',
], $provider->data());
}
public function test_connect(): void
{
$provider = new Discord(NotificationChannel::factory()->create([
'provider' => 'discord',
'data' => [
'webhook_url' => 'https://discord.com/xxxxx',
],
]));
Http::fake();
$this->assertTrue($provider->connect());
Http::assertSent(function ($request) {
return $request->url() === 'https://discord.com/xxxxx';
});
}
public function test_send(): void
{
$channel = NotificationChannel::factory()->create([
'provider' => 'discord',
'data' => [
'webhook_url' => 'https://discord.com/xxxxx',
],
]);
$provider = new Discord($channel);
Http::fake();
$provider->send($channel, new TestNotification());
Http::assertSent(function (Request $request) {
return $request->body() === '{"content":"Hello"}';
});
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace Tests\Unit\NotificationChannels;
use App\Mail\NotificationMail;
use App\Models\NotificationChannel;
use App\NotificationChannels\Email;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
class EmailTest extends TestCase
{
public function test_create_rules(): void
{
$provider = new Email(NotificationChannel::factory()->create([
'provider' => 'email',
]));
$this->assertSame([
'email' => 'required|email',
], $provider->createRules([]));
}
public function test_create_data(): void
{
$provider = new Email(NotificationChannel::factory()->create([
'provider' => 'email',
]));
$this->assertSame([
'email' => 'user@example.com',
], $provider->createData([
'email' => 'user@example.com',
]));
}
public function test_data(): void
{
$provider = new Email(NotificationChannel::factory()->create([
'provider' => 'email',
'data' => [
'email' => 'user@example.com',
],
]));
$this->assertSame([
'email' => 'user@example.com',
], $provider->data());
}
public function test_connect(): void
{
$provider = new Email(NotificationChannel::factory()->create([
'provider' => 'email',
'data' => [
'email' => 'user@example.com',
],
]));
Mail::fake();
$this->assertTrue($provider->connect());
Mail::assertSent(NotificationMail::class);
}
public function test_send(): void
{
$channel = NotificationChannel::factory()->create([
'provider' => 'email',
'data' => [
'email' => 'user@example.com',
],
]);
$provider = new Email($channel);
Mail::fake();
$provider->send($channel, new TestNotification());
Mail::assertSent(NotificationMail::class);
}
}

View File

@ -0,0 +1,87 @@
<?php
namespace Tests\Unit\NotificationChannels;
use App\Models\NotificationChannel;
use App\NotificationChannels\Slack;
use Illuminate\Http\Client\Request;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class SlackTest extends TestCase
{
public function test_create_rules(): void
{
$provider = new Slack(NotificationChannel::factory()->create([
'provider' => 'slack',
]));
$this->assertSame([
'webhook_url' => 'required|url',
], $provider->createRules([]));
}
public function test_create_data(): void
{
$provider = new Slack(NotificationChannel::factory()->create([
'provider' => 'slack',
]));
$this->assertSame([
'webhook_url' => 'https://slack.com/xxxxx',
], $provider->createData([
'webhook_url' => 'https://slack.com/xxxxx',
]));
}
public function test_data(): void
{
$provider = new Slack(NotificationChannel::factory()->create([
'provider' => 'slack',
'data' => [
'webhook_url' => 'https://slack.com/xxxxx',
],
]));
$this->assertSame([
'webhook_url' => 'https://slack.com/xxxxx',
], $provider->data());
}
public function test_connect(): void
{
$provider = new Slack(NotificationChannel::factory()->create([
'provider' => 'slack',
'data' => [
'webhook_url' => 'https://slack.com/xxxxx',
],
]));
Http::fake();
$this->assertTrue($provider->connect());
Http::assertSent(function ($request) {
return $request->url() === 'https://slack.com/xxxxx';
});
}
public function test_send(): void
{
$channel = NotificationChannel::factory()->create([
'provider' => 'slack',
'data' => [
'webhook_url' => 'https://slack.com/xxxxx',
],
]);
$provider = new Slack($channel);
Http::fake();
$provider->send($channel, new TestNotification());
Http::assertSent(function (Request $request) {
return $request->body() === '{"text":"Hello"}';
});
}
}

View File

@ -0,0 +1,108 @@
<?php
namespace Tests\Unit\NotificationChannels;
use App\Models\NotificationChannel;
use App\NotificationChannels\Telegram;
use Illuminate\Http\Client\Request;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
class TelegramTest extends TestCase
{
public function test_create_rules(): void
{
$provider = new Telegram(NotificationChannel::factory()->create([
'provider' => 'telegram',
]));
$this->assertSame([
'bot_token' => 'required|string',
'chat_id' => 'required',
], $provider->createRules([]));
}
public function test_create_data(): void
{
$provider = new Telegram(NotificationChannel::factory()->create([
'provider' => 'telegram',
]));
$this->assertSame([
'bot_token' => 'xxxxx',
'chat_id' => '12345',
], $provider->createData([
'bot_token' => 'xxxxx',
'chat_id' => '12345',
]));
}
public function test_data(): void
{
$provider = new Telegram(NotificationChannel::factory()->create([
'provider' => 'telegram',
'data' => [
'bot_token' => 'xxxxx',
'chat_id' => '12345',
],
]));
$this->assertSame([
'bot_token' => 'xxxxx',
'chat_id' => '12345',
], $provider->data());
}
public function test_connect(): void
{
$provider = new Telegram(NotificationChannel::factory()->create([
'provider' => 'telegram',
'data' => [
'bot_token' => 'xxxxx',
'chat_id' => '12345',
],
]));
Http::fake();
$this->assertTrue($provider->connect());
Http::assertSent(function ($request) {
if ($request->url() === 'https://api.telegram.org/botxxxxx/sendMessage') {
return $request->data() === [
'chat_id' => '12345',
'text' => 'Connected!',
'parse_mode' => 'markdown',
'disable_web_page_preview' => true,
];
}
});
}
public function test_send(): void
{
$channel = NotificationChannel::factory()->create([
'provider' => 'telegram',
'data' => [
'bot_token' => 'xxxxx',
'chat_id' => '12345',
],
]);
$provider = new Telegram($channel);
Http::fake();
$provider->send($channel, new TestNotification());
Http::assertSent(function (Request $request) {
if ($request->url() === 'https://api.telegram.org/botxxxxx/sendMessage') {
return $request->data() === [
'chat_id' => '12345',
'text' => 'Hello',
'parse_mode' => 'markdown',
'disable_web_page_preview' => true,
];
}
});
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Tests\Unit\NotificationChannels;
use App\Notifications\AbstractNotification;
class TestNotification extends AbstractNotification
{
public function rawText(): string
{
return 'Hello';
}
}

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\CronJob; namespace Tests\Unit\SSHCommands\CronJob;
use App\SSHCommands\CronJob\UpdateCronJobsCommand; use App\SSHCommands\CronJob\UpdateCronJobsCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\BackupDatabaseCommand; use App\SSHCommands\Database\BackupDatabaseCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\CreateCommand; use App\SSHCommands\Database\CreateCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\CreateUserCommand; use App\SSHCommands\Database\CreateUserCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\DeleteCommand; use App\SSHCommands\Database\DeleteCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\DeleteUserCommand; use App\SSHCommands\Database\DeleteUserCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\InstallMariadbCommand; use App\SSHCommands\Database\InstallMariadbCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\InstallMysqlCommand; use App\SSHCommands\Database\InstallMysqlCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\LinkCommand; use App\SSHCommands\Database\LinkCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Database; namespace Tests\Unit\SSHCommands\Database;
use App\SSHCommands\Database\UnlinkCommand; use App\SSHCommands\Database\UnlinkCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Firewall; namespace Tests\Unit\SSHCommands\Firewall;
use App\SSHCommands\Firewall\AddRuleCommand; use App\SSHCommands\Firewall\AddRuleCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Firewall; namespace Tests\Unit\SSHCommands\Firewall;
use App\SSHCommands\Firewall\InstallUfwCommand; use App\SSHCommands\Firewall\InstallUfwCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Firewall; namespace Tests\Unit\SSHCommands\Firewall;
use App\SSHCommands\Firewall\RemoveRuleCommand; use App\SSHCommands\Firewall\RemoveRuleCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Installation; namespace Tests\Unit\SSHCommands\Installation;
use App\SSHCommands\Installation\InstallNodejsCommand; use App\SSHCommands\Installation\InstallNodejsCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Installation; namespace Tests\Unit\SSHCommands\Installation;
use App\SSHCommands\Installation\InstallRedisCommand; use App\SSHCommands\Installation\InstallRedisCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Installation; namespace Tests\Unit\SSHCommands\Installation;
use App\SSHCommands\Installation\InstallRequirementsCommand; use App\SSHCommands\Installation\InstallRequirementsCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\ChangeNginxPHPVersionCommand; use App\SSHCommands\Nginx\ChangeNginxPHPVersionCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\CreateNginxVHostCommand; use App\SSHCommands\Nginx\CreateNginxVHostCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\DeleteNginxSiteCommand; use App\SSHCommands\Nginx\DeleteNginxSiteCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\InstallNginxCommand; use App\SSHCommands\Nginx\InstallNginxCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\UpdateNginxRedirectsCommand; use App\SSHCommands\Nginx\UpdateNginxRedirectsCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Nginx; namespace Tests\Unit\SSHCommands\Nginx;
use App\SSHCommands\Nginx\UpdateNginxVHostCommand; use App\SSHCommands\Nginx\UpdateNginxVHostCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\ChangeDefaultPHPCommand; use App\SSHCommands\PHP\ChangeDefaultPHPCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\GetPHPIniCommand; use App\SSHCommands\PHP\GetPHPIniCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\InstallComposerCommand; use App\SSHCommands\PHP\InstallComposerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\InstallPHPCommand; use App\SSHCommands\PHP\InstallPHPCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\InstallPHPExtensionCommand; use App\SSHCommands\PHP\InstallPHPExtensionCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHP; namespace Tests\Unit\SSHCommands\PHP;
use App\SSHCommands\PHP\UninstallPHPCommand; use App\SSHCommands\PHP\UninstallPHPCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHPMyAdmin; namespace Tests\Unit\SSHCommands\PHPMyAdmin;
use App\SSHCommands\PHPMyAdmin\CreateNginxPHPMyAdminVHostCommand; use App\SSHCommands\PHPMyAdmin\CreateNginxPHPMyAdminVHostCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHPMyAdmin; namespace Tests\Unit\SSHCommands\PHPMyAdmin;
use App\SSHCommands\PHPMyAdmin\DeleteNginxPHPMyAdminVHostCommand; use App\SSHCommands\PHPMyAdmin\DeleteNginxPHPMyAdminVHostCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\PHPMyAdmin; namespace Tests\Unit\SSHCommands\PHPMyAdmin;
use App\SSHCommands\PHPMyAdmin\DownloadPHPMyAdminCommand; use App\SSHCommands\PHPMyAdmin\DownloadPHPMyAdminCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\SSL; namespace Tests\Unit\SSHCommands\SSL;
use App\SSHCommands\SSL\CreateCustomSSLCommand; use App\SSHCommands\SSL\CreateCustomSSLCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\SSL; namespace Tests\Unit\SSHCommands\SSL;
use App\SSHCommands\SSL\CreateLetsencryptSSLCommand; use App\SSHCommands\SSL\CreateLetsencryptSSLCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\SSL; namespace Tests\Unit\SSHCommands\SSL;
use App\SSHCommands\SSL\InstallCertbotCommand; use App\SSHCommands\SSL\InstallCertbotCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\SSL; namespace Tests\Unit\SSHCommands\SSL;
use App\SSHCommands\SSL\RemoveSSLCommand; use App\SSHCommands\SSL\RemoveSSLCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Service; namespace Tests\Unit\SSHCommands\Service;
use App\SSHCommands\Service\RestartServiceCommand; use App\SSHCommands\Service\RestartServiceCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Service; namespace Tests\Unit\SSHCommands\Service;
use App\SSHCommands\Service\ServiceStatusCommand; use App\SSHCommands\Service\ServiceStatusCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Service; namespace Tests\Unit\SSHCommands\Service;
use App\SSHCommands\Service\StartServiceCommand; use App\SSHCommands\Service\StartServiceCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Service; namespace Tests\Unit\SSHCommands\Service;
use App\SSHCommands\Service\StopServiceCommand; use App\SSHCommands\Service\StopServiceCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Storage; namespace Tests\Unit\SSHCommands\Storage;
use App\SSHCommands\Storage\DownloadFromDropboxCommand; use App\SSHCommands\Storage\DownloadFromDropboxCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Storage; namespace Tests\Unit\SSHCommands\Storage;
use App\SSHCommands\Storage\DownloadFromFTPCommand; use App\SSHCommands\Storage\DownloadFromFTPCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Storage; namespace Tests\Unit\SSHCommands\Storage;
use App\SSHCommands\Storage\UploadToDropboxCommand; use App\SSHCommands\Storage\UploadToDropboxCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Storage; namespace Tests\Unit\SSHCommands\Storage;
use App\SSHCommands\Storage\UploadToFTPCommand; use App\SSHCommands\Storage\UploadToFTPCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\CreateWorkerCommand; use App\SSHCommands\Supervisor\CreateWorkerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\DeleteWorkerCommand; use App\SSHCommands\Supervisor\DeleteWorkerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\InstallSupervisorCommand; use App\SSHCommands\Supervisor\InstallSupervisorCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\RestartWorkerCommand; use App\SSHCommands\Supervisor\RestartWorkerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\StartWorkerCommand; use App\SSHCommands\Supervisor\StartWorkerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\Supervisor; namespace Tests\Unit\SSHCommands\Supervisor;
use App\SSHCommands\Supervisor\StopWorkerCommand; use App\SSHCommands\Supervisor\StopWorkerCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\CreateUserCommand; use App\SSHCommands\System\CreateUserCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\DeleteSshKeyCommand; use App\SSHCommands\System\DeleteSshKeyCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\DeploySshKeyCommand; use App\SSHCommands\System\DeploySshKeyCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\EditFileCommand; use App\SSHCommands\System\EditFileCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\GenerateSshKeyCommand; use App\SSHCommands\System\GenerateSshKeyCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\GetPublicKeyCommand; use App\SSHCommands\System\GetPublicKeyCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\ReadFileCommand; use App\SSHCommands\System\ReadFileCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\ReadSshKeyCommand; use App\SSHCommands\System\ReadSshKeyCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\RebootCommand; use App\SSHCommands\System\RebootCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\RunScriptCommand; use App\SSHCommands\System\RunScriptCommand;
use Tests\TestCase; use Tests\TestCase;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Tests\Feature\SSHCommands\System; namespace Tests\Unit\SSHCommands\System;
use App\SSHCommands\System\UpgradeCommand; use App\SSHCommands\System\UpgradeCommand;
use Tests\TestCase; use Tests\TestCase;

Some files were not shown because too many files have changed in this diff Show More