mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 13:23:04 +01:00
Added unit tests for helpers and tests for commands
This commit is contained in:
29
tests/Feature/Commands/SetSlackWebhookCommandTest.php
Normal file
29
tests/Feature/Commands/SetSlackWebhookCommandTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Commands;
|
||||
|
||||
use App\Helpers\SettingsHelper;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SetSlackWebhookCommandTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSetSlackWebhook()
|
||||
{
|
||||
SettingsHelper::set('slack_webhook', 'pre-test');
|
||||
|
||||
$this->artisan('speedtest:slack', [ 'webhook' => 'test' ])
|
||||
->expectsOutput('Slack webhook updated')
|
||||
->assertExitCode(0);
|
||||
|
||||
$this->assertEquals(SettingsHelper::get('slack_webhook')->value, 'test');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user