diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-03-07 14:45:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 14:45:43 +0100 |
commit | 8d865483f4dd98ea234ce392415679a84dda0d0f (patch) | |
tree | 1167b17c52c8bf230d73f89f71147352908a10cc /tests | |
parent | d1aa96fef91a1e5352f987d16be773cac69135a8 (diff) | |
parent | 448a5e574e91daf9ddb195bfc96695a4ab8e770f (diff) | |
download | nextcloud-server-8d865483f4dd98ea234ce392415679a84dda0d0f.tar.gz nextcloud-server-8d865483f4dd98ea234ce392415679a84dda0d0f.zip |
Merge pull request #8714 from nextcloud/8705
Check if the cached js file exists
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Template/JSCombinerTest.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/Template/JSCombinerTest.php b/tests/lib/Template/JSCombinerTest.php index d5f7000e0a5..bec88801d6b 100644 --- a/tests/lib/Template/JSCombinerTest.php +++ b/tests/lib/Template/JSCombinerTest.php @@ -187,6 +187,10 @@ class JSCombinerTest extends \Test\TestCase { $fileDeps->expects($this->once())->method('getContent')->willReturn('{}'); + $folder->method('fileExists') + ->with('combine.js') + ->willReturn(true); + $folder->method('getFile') ->will($this->returnCallback(function($path) use ($file, $fileDeps) { if ($path === 'combine.js') { @@ -196,6 +200,7 @@ class JSCombinerTest extends \Test\TestCase { if ($path === 'combine.js.deps') { return $fileDeps; } + $this->fail(); })); @@ -221,6 +226,9 @@ class JSCombinerTest extends \Test\TestCase { ->willReturn($folder); $folder->method('getName') ->willReturn('awesomeapp'); + $folder->method('fileExists') + ->with('combine.js') + ->willReturn(true); $file = $this->createMock(ISimpleFile::class); @@ -263,6 +271,9 @@ class JSCombinerTest extends \Test\TestCase { public function testIsCachedWithNotExistingFile() { $fileName = 'combine.json'; $folder = $this->createMock(ISimpleFolder::class); + $folder->method('fileExists') + ->with('combine.js') + ->willReturn(true); $file = $this->createMock(ISimpleFile::class); $folder->method('getFile') ->with('combine.js.deps') @@ -278,6 +289,9 @@ class JSCombinerTest extends \Test\TestCase { public function testIsCachedWithOlderMtime() { $fileName = 'combine.json'; $folder = $this->createMock(ISimpleFolder::class); + $folder->method('fileExists') + ->with('combine.js') + ->willReturn(true); $file = $this->createMock(ISimpleFile::class); $folder->method('getFile') ->with('combine.js.deps') @@ -293,6 +307,9 @@ class JSCombinerTest extends \Test\TestCase { public function testIsCachedWithoutContent() { $fileName = 'combine.json'; $folder = $this->createMock(ISimpleFolder::class); + $folder->method('fileExists') + ->with('combine.js') + ->willReturn(true); $file = $this->createMock(ISimpleFile::class); $folder->method('getFile') ->with('combine.js.deps') |