fixing auto install tests
This commit is contained in:
parent
677cb205f5
commit
3a0664d827
5 changed files with 47 additions and 48 deletions
|
@ -15,9 +15,9 @@ trait RendererMockTrait
|
|||
/**
|
||||
* Mocking the method 'Renderer::getMarkupTemplate()'
|
||||
*
|
||||
* @param string $templateName The name of the template which should get
|
||||
* @param string $return the return value of the mock (should be defined to have it later for followUp use)
|
||||
* @param null|int $times How often the method will get used
|
||||
* @param string $templateName The name of the template which should get
|
||||
* @param string $return the return value of the mock (should be defined to have it later for followUp use)
|
||||
* @param null|int $times How often the method will get used
|
||||
*/
|
||||
public function mockGetMarkupTemplate($templateName, $return = '', $times = null)
|
||||
{
|
||||
|
@ -35,12 +35,13 @@ trait RendererMockTrait
|
|||
/**
|
||||
* Mocking the method 'Renderer::replaceMacros()'
|
||||
*
|
||||
* @param string $template The template to use (normally, it is the mock result of 'mockGetMarkupTemplate()'
|
||||
* @param array|\Closure|null $args The arguments to pass to the macro
|
||||
* @param string $return the return value of the mock
|
||||
* @param null|int $times How often the method will get used
|
||||
* @param string $template The template to use (normally, it is the mock result of 'mockGetMarkupTemplate()'
|
||||
* @param array|\Closure|null $args The arguments to pass to the macro
|
||||
* @param bool $overwriteURL if the URL should get overwritten
|
||||
* @param string $return the return value of the mock
|
||||
* @param null|int $times How often the method will get used
|
||||
*/
|
||||
public function mockReplaceMacros($template, $args = null, $return = '', $times = null)
|
||||
public function mockReplaceMacros($template, $args = null, $overwriteURL = true, $return = '', $times = null)
|
||||
{
|
||||
if (!isset($this->rendererMock)) {
|
||||
$this->rendererMock = \Mockery::mock('alias:' . Renderer::class);
|
||||
|
@ -50,10 +51,18 @@ trait RendererMockTrait
|
|||
$args = [];
|
||||
}
|
||||
|
||||
$this->rendererMock
|
||||
->shouldReceive('replaceMacros')
|
||||
->with($template, $args)
|
||||
->times($times)
|
||||
->andReturn($return);
|
||||
if ($overwriteURL) {
|
||||
$this->rendererMock
|
||||
->shouldReceive('replaceMacros')
|
||||
->with($template, $args)
|
||||
->times($times)
|
||||
->andReturn($return);
|
||||
} else {
|
||||
$this->rendererMock
|
||||
->shouldReceive('replaceMacros')
|
||||
->with($template, $args, false)
|
||||
->times($times)
|
||||
->andReturn($return);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue