mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-25 14:59:16 +01:00
Added unit tests for helpers and tests for commands
This commit is contained in:
27
tests/Feature/Commands/GetConfigCommandTest.php
Normal file
27
tests/Feature/Commands/GetConfigCommandTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Commands;
|
||||
|
||||
use App\Helpers\SettingsHelper;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class GetConfigCommandTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetConfig()
|
||||
{
|
||||
$configJson = json_encode(SettingsHelper::getConfig(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
|
||||
|
||||
$this->artisan('speedtest:config')
|
||||
->expectsOutput($configJson)
|
||||
->assertExitCode(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user