Update tests & minor fixes

This commit is contained in:
Bubka
2022-12-09 10:52:17 +01:00
parent 7ce7067380
commit 05a39b6501
61 changed files with 2773 additions and 526 deletions

View File

@ -10,6 +10,7 @@ use Tests\FeatureTestCase;
/**
* @covers \App\Services\SettingService
* @covers \App\Facades\Settings
*/
class SettingServiceTest extends FeatureTestCase
{
@ -57,7 +58,7 @@ class SettingServiceTest extends FeatureTestCase
/**
* @test
*/
public function setUp() : void
public function setUp(): void
{
parent::setUp();
@ -238,7 +239,7 @@ class SettingServiceTest extends FeatureTestCase
/**
* Provide invalid data for validation test
*/
public function provideUndecipherableData() : array
public function provideUndecipherableData(): array
{
return [
[[
@ -316,4 +317,26 @@ class SettingServiceTest extends FeatureTestCase
self::VALUE => self::SETTING_VALUE_STRING,
]);
}
/**
* @test
*/
public function test_isUserDefined_returns_true()
{
DB::table('options')->insert(
[self::KEY => 'showTokenAsDot', self::VALUE => strval(self::SETTING_VALUE_TRUE_TRANSFORMED)]
);
$this->assertTrue(Settings::isUserDefined('showTokenAsDot'));
}
/**
* @test
*/
public function test_isUserDefined_returns_false()
{
DB::table('options')->where(self::KEY, 'showTokenAsDot')->delete();
$this->assertFalse(Settings::isUserDefined('showTokenAsDot'));
}
}