File tree Expand file tree Collapse file tree 4 files changed +27
-2
lines changed
fixtures/base-component-data-dir/empty-config-file Expand file tree Collapse file tree 4 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ public function getAuthorization(): array
136136 */
137137 public function getAction (): string
138138 {
139- return $ this ->getValue (['action ' ], '' );
139+ return $ this ->getValue (['action ' ], 'run ' );
140140 }
141141
142142 /**
Original file line number Diff line number Diff line change @@ -102,6 +102,29 @@ protected function run(): void
102102 $ this ->assertTrue ($ handler ->hasAlert ('Log message from run ' ));
103103 }
104104
105+ public function testWillNotFailWithEmptyConfigAction (): void
106+ {
107+ $ logger = $ this ->getLogger ();
108+ $ handler = new TestHandler ();
109+ $ logger ->setHandlers ([$ handler ]);
110+ putenv (sprintf (
111+ 'KBC_DATADIR=%s ' ,
112+ __DIR__ . '/fixtures/base-component-data-dir/empty-config-file '
113+ ));
114+ $ baseComponent = new class ($ logger ) extends BaseComponent
115+ {
116+ protected function run (): void
117+ {
118+ echo 'Shitty output ' ;
119+ $ this ->getLogger ()->alert ('Log message from run ' );
120+ }
121+ };
122+ $ this ->expectOutputString ('Shitty output ' );
123+ $ baseComponent ->execute ();
124+
125+ $ this ->assertTrue ($ handler ->hasAlert ('Log message from run ' ));
126+ }
127+
105128 public function testLoadInputStateFileEmptyThrowsException (): void
106129 {
107130 putenv (sprintf (
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public function testGettersWillNotFailIfKeyIsMissing(): void
108108 ],
109109 ]);
110110 $ this ->assertSame ([], $ config ->getParameters ());
111- $ this ->assertSame ('' , $ config ->getAction ());
111+ $ this ->assertSame ('run ' , $ config ->getAction ());
112112 $ this ->assertSame ([], $ config ->getAuthorization ());
113113 $ this ->assertSame ('' , $ config ->getOAuthApiAppKey ());
114114 $ this ->assertSame ('' , $ config ->getOAuthApiAppSecret ());
Original file line number Diff line number Diff line change 1+ {
2+ }
You can’t perform that action at this time.
0 commit comments