Browse Source

test numeric array override

master
Norbert Wagner 1 year ago
parent
commit
29db532049
  1. 27
      tests/SettingsTest.php
  2. 8
      tests/cfg/testing/config/conf.php
  3. 13
      tests/cfg/testing/config/default.conf.php
  4. 9
      tests/cfg/testing/config/testing.conf.php

27
tests/SettingsTest.php

@ -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);
}
}
/**

8
tests/cfg/testing/config/conf.php

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

13
tests/cfg/testing/config/default.conf.php

@ -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',
]
];

9
tests/cfg/testing/config/testing.conf.php

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

Loading…
Cancel
Save