From 730c3a36e57a5216027d1436e7272784c572aec0 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 26 Nov 2010 14:03:45 -0500 Subject: [PATCH 1/2] Update phpunit config to exclude tests from coverage report. --- test/phpunit.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/phpunit.xml b/test/phpunit.xml index c70e6b0..891fa8e 100644 --- a/test/phpunit.xml +++ b/test/phpunit.xml @@ -3,4 +3,8 @@ ./ + + ../examples + ./ + \ No newline at end of file From 225a32d5bfa6efc132114a7bf712105a044aa1a9 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 26 Nov 2010 14:05:20 -0500 Subject: [PATCH 2/2] Updating _renderTag logic around leftover section tags. Exceptions are now thrown by _renderSections, so anything left over by the time _renderTag executes should just be discarded. --- Mustache.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Mustache.php b/Mustache.php index a41502b..d0bc84b 100644 --- a/Mustache.php +++ b/Mustache.php @@ -475,21 +475,6 @@ class Mustache { */ protected function _renderTag($modifier, $tag_name) { switch ($modifier) { - case '#': - case '^': - if ($this->_throwsException(MustacheException::UNCLOSED_SECTION)) { - throw new MustacheException('Unclosed section: ' . $tag_name, MustacheException::UNCLOSED_SECTION); - } else { - return ''; - } - break; - case '/': - if ($this->_throwsException(MustacheException::UNEXPECTED_CLOSE_SECTION)) { - throw new MustacheException('Unexpected close section: ' . $tag_name, MustacheException::UNEXPECTED_CLOSE_SECTION); - } else { - return ''; - } - break; case '=': return $this->_changeDelimiter($tag_name); break; @@ -508,6 +493,12 @@ class Mustache { return $this->_renderUnescaped($tag_name); } break; + case '#': + case '^': + case '/': + // remove any leftovers from _renderSections + return ''; + break; } if ($this->_hasPragma(self::PRAGMA_UNESCAPED)) {