@@ -13,6 +13,8 @@ final class ConfigurationTest extends TestCase
1313 public function testProcessConfigurationWithDefaultConfiguration (): void
1414 {
1515 $ expectedBundleDefaultConfig = [
16+ 'ping_error_response_code ' => null ,
17+ 'health_error_response_code ' => null ,
1618 'health_checks ' => [],
1719 'ping_checks ' => [],
1820 ];
@@ -27,8 +29,12 @@ public function testProcessConfigurationHealthChecks(): void
2729 ['id ' => 'symfony_health_check.doctrine_check ' ],
2830 ],
2931 'ping_checks ' => [],
32+ 'ping_error_response_code ' => null ,
33+ 'health_error_response_code ' => null ,
3034 ];
31- $ new = ['health_checks ' => [['id ' => 'symfony_health_check.doctrine_check ' ]], 'ping_checks ' => []];
35+ $ new = ['health_checks ' => [
36+ ['id ' => 'symfony_health_check.doctrine_check ' ]
37+ ], 'ping_checks ' => []];
3238
3339 self ::assertSame (
3440 $ expectedConfig ,
@@ -43,8 +49,12 @@ public function testProcessConfigurationPing(): void
4349 'ping_checks ' => [
4450 ['id ' => 'symfony_health_check.doctrine_check ' ]
4551 ],
52+ 'ping_error_response_code ' => null ,
53+ 'health_error_response_code ' => null ,
4654 ];
47- $ new = ['health_checks ' => [], 'ping_checks ' => [['id ' => 'symfony_health_check.doctrine_check ' ]]];
55+ $ new = ['health_checks ' => [], 'ping_checks ' => [
56+ ['id ' => 'symfony_health_check.doctrine_check ' ]
57+ ]];
4858
4959 self ::assertSame (
5060 $ expectedConfig ,
@@ -61,6 +71,8 @@ public function testProcessConfigurationPingAndHealthChecks(): void
6171 'ping_checks ' => [
6272 ['id ' => 'symfony_health_check.doctrine_check ' ]
6373 ],
74+ 'ping_error_response_code ' => null ,
75+ 'health_error_response_code ' => null ,
6476 ];
6577 $ new = [
6678 'health_checks ' => [['id ' => 'symfony_health_check.doctrine_check ' ]],
@@ -73,6 +85,31 @@ public function testProcessConfigurationPingAndHealthChecks(): void
7385 );
7486 }
7587
88+ public function testProcessConfigurationCustomErrorCode (): void
89+ {
90+ $ expectedConfig = [
91+ 'health_checks ' => [
92+ ['id ' => 'symfony_health_check.doctrine_check ' ]
93+ ],
94+ 'ping_checks ' => [
95+ ['id ' => 'symfony_health_check.doctrine_check ' ]
96+ ],
97+ 'ping_error_response_code ' => 404 ,
98+ 'health_error_response_code ' => 500 ,
99+ ];
100+ $ new = [
101+ 'health_checks ' => [['id ' => 'symfony_health_check.doctrine_check ' ]],
102+ 'ping_checks ' => [['id ' => 'symfony_health_check.doctrine_check ' ]],
103+ 'ping_error_response_code ' => 404 ,
104+ 'health_error_response_code ' => 500 ,
105+ ];
106+
107+ self ::assertSame (
108+ $ expectedConfig ,
109+ $ this ->processConfiguration ($ new )
110+ );
111+ }
112+
76113 private function processConfiguration (array $ values ): array
77114 {
78115 $ processor = new Processor ();
0 commit comments