Skip to content

Commit e55e58e

Browse files
Test custom value settings
1 parent 65bbdcc commit e55e58e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/unit/Config/FactoryTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ public function testCreate(): void
2424
$this->assertCount(1, $config->getHookConfig('pre-commit')->getActions());
2525
}
2626

27+
public function testCustomValuesCanBeDefined(): void
28+
{
29+
$config = Factory::create(CH_PATH_FILES . '/config/valid-with-all-settings.json');
30+
$custom = $config->getCustomSettings();
31+
32+
$this->assertEquals('bar', $custom['foo']);
33+
}
34+
2735
public function testOverwriteConfigSettingsBySettingsConfigFile(): void
2836
{
2937
$config = Factory::create(realpath(CH_PATH_FILES . '/config/config-file/captainhook.json'));

tests/unit/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function testCanBeExportedToJsonDataWithSettings(): void
175175
$config = new Config(
176176
'./no-config.json',
177177
false,
178-
['run-path' => '/usr/local/bin/captainhook', 'verbosity' => 'debug']
178+
['run-path' => '/usr/local/bin/captainhook', 'verbosity' => 'debug', 'custom' => ['foo' => 'bar']]
179179
);
180180
$json = $config->getJsonData();
181181

0 commit comments

Comments
 (0)