Skip to content

Commit

Permalink
Add cacheDirectory() unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Nov 14, 2020
1 parent 5db12cb commit f4e169a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Phug/Phug/Phug/Phug.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public static function cacheDirectory($source, $destination = null, $options = n

if (!is_array($options)) {
throw new InvalidArgumentException(
"Expected \$options to be an array, got: ".
'Expected $options to be an array, got: '.
(@var_export($options, true) ?: (is_object($options) ? get_class($options) : gettype($options)))
);
}
Expand Down
10 changes: 10 additions & 0 deletions tests/Phug/OptimizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ public function testUpToDateCheck()
);
}

/**
* @covers \Phug\Phug::cacheDirectory
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Expected $options to be an array, got: 'biz'
*/
public function testCacheDirectoryWithWrongOptions()
{
Phug::cacheDirectory('foo', 'bar', 'biz');
}

/**
* @covers ::getLocator
* @covers ::isExpired
Expand Down

0 comments on commit f4e169a

Please sign in to comment.