Added unit tests for helpers and tests for commands

This commit is contained in:
Henry Whitaker
2020-08-25 18:26:21 +01:00
parent b30ec477f4
commit 94e4919b44
21 changed files with 927 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Unit\Helpers\SettingsHelper;
use App\Helpers\SettingsHelper;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class SettingsLoadIntegrationsConfigTest extends TestCase
{
use RefreshDatabase;
/**
* A basic feature test example.
*
* @return void
*/
public function testLoadIntegrationsConfig()
{
$preLoad = [
"healthchecks_enabled" => false,
"healthchecks_uuid" => null,
"slack_webhook" => null,
"telegram_bot_token" => null,
"telegram_chat_id" => null,
];
SettingsHelper::set('slack_webhook', 'test');
SettingsHelper::loadIntegrationConfig();
$this->assertEquals(config('integrations.slack_webhook'), 'test');
}
}