CodeExplorer getToolkitMock example
protected function getTestImage($load_expected = TRUE, array
$stubs =
[]) { if (!
$load_expected && !
in_array('load',
$stubs)) { $stubs =
array_merge(['load'
],
$stubs);
} $this->toolkit =
$this->
getToolkitMock($stubs);
$this->toolkit->
expects($this->
any()) ->
method('getPluginId'
) ->
willReturn('gd'
);
if (!
$load_expected) { $this->toolkit->
expects($this->
never()) ->
method('load'
);
} $this->image =
new Image($this->toolkit,
$this->source
);