Fix unit tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
pull/9984/head
Roeland Jago Douma 2018-07-19 23:15:56 +07:00
parent 37a4d2bbbc
commit 9d94cc1697
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 5 additions and 6 deletions

@ -113,7 +113,7 @@ class SCSSCacherTest extends \Test\TestCase {
$fileDeps = $this->createMock(ISimpleFile::class);
$gzfile = $this->createMock(ISimpleFile::class);
$filePrefix = substr(md5(\OC_Util::getVersionString('core')), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud'), 0, 4) . '-';
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-';
$folder->method('getFile')
->will($this->returnCallback(function($path) use ($file, $gzfile, $filePrefix) {
@ -153,7 +153,7 @@ class SCSSCacherTest extends \Test\TestCase {
$fileDeps = $this->createMock(ISimpleFile::class);
$gzfile = $this->createMock(ISimpleFile::class);
$filePrefix = substr(md5(\OC_Util::getVersionString('core')), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud'), 0, 4) . '-';
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-';
$folder->method('getFile')
->will($this->returnCallback(function($path) use ($file, $gzfile, $filePrefix) {
@ -189,7 +189,7 @@ class SCSSCacherTest extends \Test\TestCase {
$fileDeps->expects($this->any())->method('getSize')->willReturn(1);
$gzFile = $this->createMock(ISimpleFile::class);
$filePrefix = substr(md5(\OC_Util::getVersionString('core')), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud'), 0, 4) . '-';
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-';
$folder->method('getFile')
->will($this->returnCallback(function($name) use ($file, $fileDeps, $gzFile, $filePrefix) {
@ -227,9 +227,8 @@ class SCSSCacherTest extends \Test\TestCase {
$fileDeps->expects($this->any())->method('getSize')->willReturn(1);
$gzFile = $this->createMock(ISimpleFile::class);
$filePrefix = substr(md5('http://localhost/nextcloud'), 0, 8) . '-';
$filePrefix = substr(md5(\OC_Util::getVersionString('core')), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud'), 0, 4) . '-';
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-';
$folder->method('getFile')
->will($this->returnCallback(function($name) use ($file, $fileDeps, $gzFile, $filePrefix) {
if ($name === $filePrefix.'styles.css') {
@ -447,7 +446,7 @@ class SCSSCacherTest extends \Test\TestCase {
->method('linkToRoute')
->with('core.Css.getCss', [
'fileName' => substr(md5($version), 0, 4) . '-' .
substr(md5('http://localhost/nextcloud'), 0, 4) . '-styles.css',
substr(md5('http://localhost/nextcloud/index.php'), 0, 4) . '-styles.css',
'appName' => $appName
])
->willReturn(\OC::$WEBROOT . $result);