mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-15 16:22:25 +02:00
Update tests & minor fixes
This commit is contained in:
@ -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'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user