Skip to content

Commit

Permalink
Test config option rule: null -> hardcoded default, false -> disabled (
Browse files Browse the repository at this point in the history
  • Loading branch information
pabzm authored Nov 5, 2024
1 parent a07d61a commit 06c5e01
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Framework/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public function test_get_and_set()

$this->assertSame(4190, $object->get('test_int'));

// If the configured value is `null`, expect the fallback value (which is `null` by default).
$object->set('test', null);
$this->assertNull($object->get('test'));
$this->assertSame('fallback', $object->get('test', 'fallback'));

// If the configured value is `false`, expect `false`, regardless of the fallback value.
$object->set('test', false);
$this->assertFalse($object->get('test'));
$this->assertFalse($object->get('test', 'wrong'));

// TODO: test more code paths in get() and set()
}

Expand Down

0 comments on commit 06c5e01

Please sign in to comment.