* Use database for kvp storage * Read kvpstore * Add web cron ability through API #821 * Style fixes * Fix text
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user