This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/ZendDiagnostics/Runner
tests/ZendDiagnosticsTest Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function run($checkAlias = null)
103103 {
104104 $ results = new ResultsCollection ();
105105
106- $ checks = $ checkAlias ? new ArrayObject (array ($ this ->getCheck ($ checkAlias ))) : $ this ->getChecks ();
106+ $ checks = $ checkAlias ? new ArrayObject (array ($ checkAlias => $ this ->getCheck ($ checkAlias ))) : $ this ->getChecks ();
107107
108108 // Trigger START event
109109 $ this ->triggerReporters ('onStart ' , $ checks , $ this ->getConfig ());
Original file line number Diff line number Diff line change @@ -230,6 +230,17 @@ public function testAfterRun()
230230 $ this ->runner ->run ();
231231 }
232232
233+ public function testAliasIsKeptAfterRun ()
234+ {
235+ $ checkAlias = 'foo ' ;
236+ $ check = new AlwaysSuccess ();
237+ $ this ->runner ->addCheck ($ check , $ checkAlias );
238+ $ mock = $ this ->getMock ('ZendDiagnosticsTest\TestAsset\Reporter\AbstractReporter ' , array ('onAfterRun ' ));
239+ $ mock ->expects ($ this ->once ())->method ('onAfterRun ' )->with ($ this ->identicalTo ($ check ), $ check ->check (), $ checkAlias );
240+ $ this ->runner ->addReporter ($ mock );
241+ $ this ->runner ->run ($ checkAlias );
242+ }
243+
233244 /**
234245 * @dataProvider checksAndResultsProvider
235246 */
You can’t perform that action at this time.
0 commit comments