test numeric array override

This commit is contained in:
Norbert Wagner 2021-01-14 18:30:36 +01:00
parent ed554705e5
commit 29db532049
4 changed files with 54 additions and 3 deletions

View File

@ -139,6 +139,33 @@ class SettingsTest extends TestCase
$this->assertEquals('testing', $cfg->testFiles);
$this->assertEquals(42, $cfg->answer);
return $cfg;
}
/**
* @depends testTestingOverride
*/
public function testTestingNumArrayOverride(Settings $cfg)
{
$data = [
0 => 'Index0_test',
1 => 'Index1_default',
2 => 'Index2_test',
3 => 'Index3_local',
4 => 'Index4_local',
5 => 'Index5_local',
6 => 'Index6_default',
7 => 'Index7_default',
10 => 'Index10_test'
];
$numArray = $cfg->numArray;
foreach ($numArray as $key => $value)
{
$this->assertEquals($data[$key], $value);
}
}
/**

View File

@ -1,3 +1,9 @@
<?php return [
'mode' => 'test'
'mode' => 'test',
'numArray' =>
[
3 => 'Index3_local',
4 => 'Index4_local',
5 => 'Index5_local',
]
];

View File

@ -1,5 +1,16 @@
<?php return [
'mode' => 'prod',
'testFiles' => 'testing',
'answer' => false
'answer' => false,
'numArray' =>
[
0 => 'Index0_default',
1 => 'Index1_default',
2 => 'Index2_default',
3 => 'Index3_default',
4 => 'Index4_default',
5 => 'Index5_default',
6 => 'Index6_default',
7 => 'Index7_default',
]
];

View File

@ -1,3 +1,10 @@
<?php return [
'answer' => 42
'answer' => 42,
'numArray' =>
[
0 => 'Index0_test',
2 => 'Index2_test',
5 => 'Index5_test',
10 => 'Index10_test',
]
];