1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Set export service to set correct svg image mimetype

For #1538
This commit is contained in:
Dan Brown
2019-07-17 22:36:49 +01:00
parent 629b7a674e
commit 1e7df28238
3 changed files with 35 additions and 1 deletions

View File

@ -11,6 +11,7 @@ use BookStack\Auth\Role;
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Entities\Repos\PageRepo;
use BookStack\Settings\SettingService;
use BookStack\Uploads\HttpFetcher;
trait SharedTestHelpers
{
@ -189,4 +190,18 @@ trait SharedTestHelpers
return $permissionRepo->saveNewRole($roleData);
}
/**
* Mock the HttpFetcher service and return the given data on fetch.
* @param $returnData
* @param int $times
*/
protected function mockHttpFetch($returnData, int $times = 1)
{
$mockHttp = \Mockery::mock(HttpFetcher::class);
$this->app[HttpFetcher::class] = $mockHttp;
$mockHttp->shouldReceive('fetch')
->times($times)
->andReturn($returnData);
}
}