Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ElGigi committed Apr 14, 2021
1 parent b0089b5 commit a78cc64
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,40 @@ public function testHas()
}

public function testGetArrayCopy()
{
$config = new FakeConfig(
[
new JsonAdapter(__DIR__ . '/config.json5', true, priority: 0),
new JsonAdapter(__DIR__ . '/config3.json5', true, priority: 10),
new JsonAdapter(__DIR__ . '/config2.json5', true, priority: 1),
],
variables: ['QUX' => 'QUX QUX QUX']
);
$array = [
"foo" => "ERASE ARRAY",
"bar" => ["ERASE STRING"],
"qux" => "QUX VALUE",
"section" => [
"foo" => "value",
"qux" => [
"{var:QUX}",
"{= QUX}",
"value2",
"{not}",
]
],
"section2" => [
"bar" => "{config:section.foo}-test",
"baz" => 123456,
"qux" => "{config:section2.baz}",
],
"baz" => true
];

$this->assertEquals($array, $config->getArrayCopy());
}

public function testGetArrayCopy_compiled()
{
$config = new FakeConfig(
[
Expand Down Expand Up @@ -145,6 +179,6 @@ public function testGetArrayCopy()
"baz" => true
];

$this->assertEquals($array, $config->getArrayCopy());
$this->assertEquals($array, $config->getArrayCopy(true));
}
}

0 comments on commit a78cc64

Please sign in to comment.