Explorar o código

Mark a few things we can't really get code coverage for.

Justin Hileman %!s(int64=8) %!d(string=hai) anos
pai
achega
6a527de467

+ 6 - 0
src/Mustache/Cache/FilesystemCache.php

@@ -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
     }
 }

+ 1 - 1
src/Mustache/Exception/SyntaxException.php

@@ -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
         }
     }
 

+ 1 - 1
src/Mustache/Exception/UnknownFilterException.php

@@ -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
         }
     }
 

+ 1 - 1
src/Mustache/Exception/UnknownHelperException.php

@@ -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
         }
     }
 

+ 1 - 1
src/Mustache/Exception/UnknownTemplateException.php

@@ -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
         }
     }
 

+ 5 - 0
src/Mustache/Tokenizer.php

@@ -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;
     }