* Use database for kvp storage * Read kvpstore * Add web cron ability through API #821 * Style fixes * Fix text
This commit is contained in:
@@ -12,6 +12,7 @@ use App\Models\News;
|
||||
use App\Models\Subfleet;
|
||||
use App\Models\User;
|
||||
use App\Services\FareService;
|
||||
use App\Support\Utils;
|
||||
use Exception;
|
||||
use function random_int;
|
||||
|
||||
@@ -312,4 +313,21 @@ class ApiTest extends TestCase
|
||||
$this->assertNotNull($user);
|
||||
$this->assertTrue(strpos($user['avatar'], 'gravatar') !== -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that the web cron runs
|
||||
*/
|
||||
public function testWebCron()
|
||||
{
|
||||
$this->updateSetting('cron.random_id', '');
|
||||
$this->get('/api/cron/sdf')->assertStatus(400);
|
||||
|
||||
$id = Utils::generateNewId(24);
|
||||
$this->updateSetting('cron.random_id', $id);
|
||||
|
||||
$this->get('/api/cron/sdf')->assertStatus(400);
|
||||
|
||||
$res = $this->get('/api/cron/'.$id);
|
||||
$res->assertStatus(200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user