Add web cron ability #821 (#1073)

* Use database for kvp storage

* Read kvpstore

* Add web cron ability through API #821

* Style fixes

* Fix text
This commit is contained in:
Nabeel S
2021-03-09 11:36:56 -05:00
committed by GitHub
parent f1c54bcc7c
commit e70ee5aa6f
13 changed files with 243 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
namespace Tests;
use App\Repositories\KvpRepository;
use App\Support\ICAO;
use App\Support\Units\Time;
use App\Support\Utils;
@@ -15,6 +16,24 @@ class UtilsTest extends TestCase
$this->assertNotNull($carbon);
}
/**
* Simple test for KVP
*/
public function testKvp()
{
/** @var KvpRepository $kvpRepo */
$kvpRepo = app(KvpRepository::class);
$kvpRepo->save('testkey', 'some value');
$this->assertEquals('some value', $kvpRepo->get('testkey'));
// test that default value is working
$this->assertEquals('default value', $kvpRepo->get('unknownkey', 'default value'));
// try saving an integer
$kvpRepo->save('intval', 1);
$this->assertEquals(1, $kvpRepo->get('intval'));
}
/**
* @throws \Exception
*/