Skip to content

Commit

Permalink
Test json value serializer with boolean setting value checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Sep 28, 2023
1 parent caf6162 commit a58fd85
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Feature/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@
->and(SettingsFacade::isFalse('app.debug'))->toBeFalse();
});

it('can evaluate boolean stored settings using the json value serializer', function () {
$settings = settings();
(fn () => $this->valueSerializer = new JsonValueSerializer)->call($settings);

$settings->set('app.debug', '1');
expect($settings->isTrue('app.debug'))->toBeTrue();

$settings->set('app.debug', '0');
expect($settings->isTrue('app.debug'))->toBeFalse()
->and($settings->isFalse('app.debug'))->toBeTrue();

$settings->set('app.debug', true);
expect($settings->isTrue('app.debug'))->toBeTrue()
->and($settings->isFalse('app.debug'))->toBeFalse();
});

it('can cache values on retrieval', function () {
enableSettingsCache();

Expand Down

0 comments on commit a58fd85

Please sign in to comment.