Files
Speedtest-Tracker/tests/Feature/ConfigTest.php
Henry Whitaker 7640f22db8 Added unit tests
2020-07-24 11:46:08 +01:00

42 lines
941 B
PHP

<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class ConfigTest extends TestCase
{
use RefreshDatabase;
private $configStructure = [
'base',
'graphs' => [
'download_upload_graph_enabled' => [],
'download_upload_graph_width' => [],
'ping_graph_enabled' => [],
'ping_graph_width' => [],
'failure_graph_enabled' => [],
'failure_graph_width' => [],
],
'editable' => [
'slack_webhook',
'telegram_bot_token',
'telegram_chat_id'
],
];
/**
* Test config returned by API
*
* @return void
*/
public function testAPIConfig()
{
$response = $this->get('api/settings/config');
$response->assertJsonStructure($this->configStructure);
}
}