File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -86,5 +86,35 @@ public function testExecutePlugin_ReturnsPluginSuccess()
86
86
$ this ->assertEquals ($ expectedReturnValue , $ returnValue );
87
87
}
88
88
89
+ public function testExecutePlugin_LogsFailureForNonExistentClasses ()
90
+ {
91
+ $ options = array ();
92
+ $ pluginName = 'DOESNTEXIST ' ;
93
+ $ pluginNamespace = 'PHPCI \\Plugin \\' ;
94
+
95
+ $ this ->mockBuildLogger ->logFailure ('Plugin does not exist: ' . $ pluginName )->shouldBeCalledTimes (1 );
96
+
97
+ $ this ->testedExecutor ->executePlugin ($ pluginName , $ options );
98
+ }
99
+
100
+ public function testExecutePlugin_LogsFailureWhenExceptionsAreThrownByPlugin ()
101
+ {
102
+ $ options = array ();
103
+ $ pluginName = 'PhpUnit ' ;
104
+ $ pluginNamespace = 'PHPCI \\Plugin \\' ;
105
+
106
+ $ expectedException = new \RuntimeException ("Generic Error " );
107
+
108
+ $ mockPlugin = $ this ->prophesize ('PHPCI\Plugin ' );
109
+ $ mockPlugin ->execute ()->willThrow ($ expectedException );
110
+
111
+ $ this ->mockFactory ->buildPlugin ($ pluginNamespace . $ pluginName , $ options )->willReturn ($ mockPlugin ->reveal ());
112
+
113
+ $ this ->mockBuildLogger ->logFailure ('EXCEPTION: ' . $ expectedException ->getMessage (), $ expectedException )
114
+ ->shouldBeCalledTimes (1 );
115
+
116
+ $ this ->testedExecutor ->executePlugin ($ pluginName , $ options );
117
+ }
118
+
89
119
}
90
120
You can’t perform that action at this time.
0 commit comments