public function getMockPluginsService($returnPlugin = true, $installPluginResponse = true, $enablePluginResponse = true, $disablePluginResponse = true, $uninstallPluginResponse = true)
{
$mock = $this->getMockBuilder(PluginsService::class)->getMock();
$mock->expects($this->any())->method('getPlugin')->willReturn($returnPlugin ? $this->getMockBasePlugin() : null);
if ($installPluginResponse) {
$mock->expects($this->any())->method('installPlugin')->willReturn($installPluginResponse);
} else {
$mock->expects($this->any())->method('installPlugin')->willThrowException(new Exception());
}
$mock->expects($this->any())->method('enablePlugin')->willReturn($enablePluginResponse);
$mock->expects($this->any())->method('disablePlugin')->willReturn($disablePluginResponse);
$mock->expects($this->any())->method('uninstallPlugin')->willReturn($uninstallPluginResponse);
return $mock;
}