Mark a few things we can't really get code coverage for.
This commit is contained in:
@@ -108,9 +108,11 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
||||
);
|
||||
|
||||
@mkdir($dirName, 0777, true);
|
||||
// @codeCoverageIgnoreStart
|
||||
if (!is_dir($dirName)) {
|
||||
throw new Mustache_Exception_RuntimeException(sprintf('Failed to create cache directory "%s".', $dirName));
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
return $dirName;
|
||||
@@ -143,13 +145,17 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache
|
||||
return;
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
$this->log(
|
||||
Mustache_Logger::ERROR,
|
||||
'Unable to rename Mustache temp cache file: "{tempName}" -> "{fileName}"',
|
||||
array('tempName' => $tempFile, 'fileName' => $fileName)
|
||||
);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new Mustache_Exception_RuntimeException(sprintf('Failed to write cache file "%s".', $fileName));
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
parent::__construct($msg, 0, $previous);
|
||||
} else {
|
||||
parent::__construct($msg);
|
||||
parent::__construct($msg); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
parent::__construct($message, 0, $previous);
|
||||
} else {
|
||||
parent::__construct($message);
|
||||
parent::__construct($message); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
parent::__construct($message, 0, $previous);
|
||||
} else {
|
||||
parent::__construct($message);
|
||||
parent::__construct($message); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti
|
||||
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
|
||||
parent::__construct($message, 0, $previous);
|
||||
} else {
|
||||
parent::__construct($message);
|
||||
parent::__construct($message); // @codeCoverageIgnore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,11 +91,14 @@ class Mustache_Tokenizer
|
||||
{
|
||||
// Setting mbstring.func_overload makes things *really* slow.
|
||||
// Let's do everyone a favor and scan this string as ASCII instead.
|
||||
//
|
||||
// @codeCoverageIgnoreStart
|
||||
$encoding = null;
|
||||
if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) {
|
||||
$encoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
$this->reset();
|
||||
|
||||
@@ -202,9 +205,11 @@ class Mustache_Tokenizer
|
||||
$this->flushBuffer();
|
||||
|
||||
// Restore the user's encoding...
|
||||
// @codeCoverageIgnoreStart
|
||||
if ($encoding) {
|
||||
mb_internal_encoding($encoding);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
return $this->tokens;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user