This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree 2 files changed +12
-1
lines changed
src/ZendDiagnostics/Runner
tests/ZendDiagnosticsTest
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)
103
103
{
104
104
$ results = new ResultsCollection ();
105
105
106
- $ checks = $ checkAlias ? new ArrayObject (array ($ this ->getCheck ($ checkAlias ))) : $ this ->getChecks ();
106
+ $ checks = $ checkAlias ? new ArrayObject (array ($ checkAlias => $ this ->getCheck ($ checkAlias ))) : $ this ->getChecks ();
107
107
108
108
// Trigger START event
109
109
$ this ->triggerReporters ('onStart ' , $ checks , $ this ->getConfig ());
Original file line number Diff line number Diff line change @@ -230,6 +230,17 @@ public function testAfterRun()
230
230
$ this ->runner ->run ();
231
231
}
232
232
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
+
233
244
/**
234
245
* @dataProvider checksAndResultsProvider
235
246
*/
You can’t perform that action at this time.
0 commit comments