Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Mar 7, 2018
1 parent 34b86ed commit 448a5e5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/lib/Template/JSCombinerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ public function testProcessCachedFile() {

$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') {
Expand All @@ -196,6 +200,7 @@ public function testProcessCachedFile() {
if ($path === 'combine.js.deps') {
return $fileDeps;
}

$this->fail();
}));

Expand All @@ -221,6 +226,9 @@ public function testProcessCachedFileMemcache() {
->willReturn($folder);
$folder->method('getName')
->willReturn('awesomeapp');
$folder->method('fileExists')
->with('combine.js')
->willReturn(true);

$file = $this->createMock(ISimpleFile::class);

Expand Down Expand Up @@ -263,6 +271,9 @@ public function testIsCachedNoDepsFile() {
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')
Expand All @@ -278,6 +289,9 @@ public function testIsCachedWithNotExistingFile() {
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')
Expand All @@ -293,6 +307,9 @@ public function testIsCachedWithOlderMtime() {
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')
Expand Down

0 comments on commit 448a5e5

Please sign in to comment.