Skip to content

Commit

Permalink
test: add test for property name with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 2, 2021
1 parent d97ee1d commit c1dfd53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/system/Config/BaseConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function testEnvironmentOverrides()
$this->assertSame('banana', $config->dessert);
// null property should not be affected
$this->assertNull($config->QEMPTYSTR);
// property name with underscore
$this->assertSame('bar', $config->onedeep_value);
}

public function testPrefixedValues()
Expand Down
2 changes: 2 additions & 0 deletions tests/system/Config/fixtures/.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ SimpleConfig.onedeep=baz
SimpleConfig.default.name=ci4
# Use underscore as separator
SimpleConfig_simple_name=complex
# Properity name with undersocre
SimpleConfig.onedeep_value=bar

## for environment override testing
SimpleConfig.alpha=pow
Expand Down
1 change: 1 addition & 0 deletions tests/system/Config/fixtures/SimpleConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ class SimpleConfig extends \CodeIgniter\Config\BaseConfig

public $shortie;
public $longie;
public $onedeep_value;
}

0 comments on commit c1dfd53

Please sign in to comment.