flatten(require base_path("config/{$file}")); } /** * Dotted paths of all leaves. A list (e.g. [1, 2, 3]) or an empty array is a value, not a branch. */ private function flatten(array $config, string $prefix = ''): array { $keys = []; foreach ($config as $key => $value) { $path = $prefix === '' ? (string) $key : "{$prefix}.{$key}"; if (is_array($value) && $value !== [] && !array_is_list($value)) { $keys = array_merge($keys, $this->flatten($value, $path)); } else { $keys[] = $path; } } return $keys; } public function test_the_default_template_has_every_setting_of_the_timebank_cc_template(): void { $missing = array_diff($this->keys('timebank_cc.php.example'), $this->keys('timebank-default.php.example')); $this->assertSame([], array_values($missing), 'Add these keys to config/timebank-default.php.example'); } public function test_the_timebank_cc_template_has_every_setting_of_the_default_template(): void { $missing = array_diff($this->keys('timebank-default.php.example'), $this->keys('timebank_cc.php.example')); $this->assertSame([], array_values($missing), 'Add these keys to config/timebank_cc.php.example'); } public function test_the_default_template_does_not_carry_the_timebank_cc_brand(): void { $source = file_get_contents(base_path('config/timebank-default.php.example')); $this->assertDoesNotMatchRegularExpression('/timebank\.cc/i', $source); } }