From 8059cdf3a54b26f87b7b49a1c50d2f4aa7459158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Wed, 30 Jun 2010 12:58:35 +0000 Subject: [PATCH] Fixed stripping of space before tal:content --- Makefile | 2 +- build.xml | 12 +-- classes/PHPTAL/ConfigurationException.php | 1 - classes/PHPTAL/Dom/CDATASection.php | 1 - classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php | 1 - classes/PHPTAL/Dom/PHPTALDocumentBuilder.php | 1 - classes/PHPTAL/Dom/XmlDeclaration.php | 1 - classes/PHPTAL/IOException.php | 1 - classes/PHPTAL/MacroMissingException.php | 1 - classes/PHPTAL/ParserException.php | 1 - .../PHPTAL/Php/Attribute/I18N/Attributes.php | 1 - classes/PHPTAL/Php/Attribute/I18N/Domain.php | 1 - .../PHPTAL/Php/Attribute/I18N/Translate.php | 1 - classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php | 1 - classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php | 1 - classes/PHPTAL/Php/Attribute/TAL/Comment.php | 1 - .../PHPTAL/Php/Attribute/TAL/Condition.php | 1 - classes/PHPTAL/Php/Attribute/TAL/OmitTag.php | 1 - classes/PHPTAL/Php/CodeWriter.php | 1 - classes/PHPTAL/Php/Transformer.php | 1 - classes/PHPTAL/PreFilter/Compress.php | 10 +-- classes/PHPTAL/TalesRegistry.php | 12 +-- doc/Makefile | 4 +- doc/en/book.xml | 80 +++++++++---------- doc/ru/book.xml | 4 +- tests/ArrayOverloadTest.php | 1 - tests/GetTextTest.php | 1 - tests/HTMLGeneratorTest.php | 1 - tests/Latin1Test.php | 1 - tests/MetalSlotTest.php | 52 ++++++------ tests/OldTest.php | 1 - tests/OverloadingTest.php | 1 - tests/PhpModeTest.php | 1 - tests/PhptalIdTest.php | 1 - tests/PhptalPathTest.php | 1 - tests/ReadableErrorTest.php | 1 - tests/TalAttributesTest.php | 1 - tests/TalOnErrorTest.php | 1 - tests/TalRepeatTest.php | 1 - tests/TalReplaceTest.php | 1 - tests/TalesIssetNullTest.php | 1 - tests/TalesPhpWithReplaceTest.php | 1 - tests/TalesRegistryTest.php | 8 +- tests/TalesTest.php | 2 +- tests/input/error-04.html | 1 - tests/input/error-05.html | 1 - tests/input/error-06.html | 1 - tests/input/error-07.html | 1 - tests/input/error-08.html | 1 - tests/input/error-09.html | 1 - tests/input/error-10.html | 1 - tests/input/error-11.html | 1 - tests/input/error-13.html | 1 - tests/input/old-17.html | 2 +- tests/locale/en_GB/LC_MESSAGES/test.php | 2 - tests/locale/fr_FR/LC_MESSAGES/test.php | 2 - tests/locale/fr_FR/LC_MESSAGES/test2.php | 2 - tools/phptal_lint.php | 12 +-- 58 files changed, 100 insertions(+), 149 deletions(-) diff --git a/Makefile b/Makefile index a4cc6ef3..af8fa2c0 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ docs:: doc:: $(MAKE) $(MFLAGS) -C doc - + clean:: @if test -d ./build/; then rm -rf ./build/; fi @find . \( -name \*.rej -o -name \*.orig -o -name .DS_Store -o -name ._\* \) -print -exec rm {} \; diff --git a/build.xml b/build.xml index d8143b06..74fda257 100644 --- a/build.xml +++ b/build.xml @@ -151,13 +151,13 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac - + - + @@ -191,8 +191,8 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac - - + + @@ -209,8 +209,8 @@ PHPTAL compiles templates to PHP for best performance and supports selective cac - - + + diff --git a/classes/PHPTAL/ConfigurationException.php b/classes/PHPTAL/ConfigurationException.php index 3b8d8848..28e760ab 100644 --- a/classes/PHPTAL/ConfigurationException.php +++ b/classes/PHPTAL/ConfigurationException.php @@ -22,4 +22,3 @@ class PHPTAL_ConfigurationException extends PHPTAL_Exception { } - diff --git a/classes/PHPTAL/Dom/CDATASection.php b/classes/PHPTAL/Dom/CDATASection.php index b7f8482f..f486fcd7 100644 --- a/classes/PHPTAL/Dom/CDATASection.php +++ b/classes/PHPTAL/Dom/CDATASection.php @@ -45,4 +45,3 @@ public function generateCode(PHPTAL_Php_CodeWriter $codewriter) } } } - diff --git a/classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php b/classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php index 2fafc44e..8729d901 100644 --- a/classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php +++ b/classes/PHPTAL/Dom/PHP5DOMDocumentBuilder.php @@ -251,4 +251,3 @@ public function setEncoding($encoding) } } } - diff --git a/classes/PHPTAL/Dom/PHPTALDocumentBuilder.php b/classes/PHPTAL/Dom/PHPTALDocumentBuilder.php index d10b3956..a73840e4 100644 --- a/classes/PHPTAL/Dom/PHPTALDocumentBuilder.php +++ b/classes/PHPTAL/Dom/PHPTALDocumentBuilder.php @@ -164,4 +164,3 @@ public function setEncoding($encoding) $this->encoding = $encoding; } } - diff --git a/classes/PHPTAL/Dom/XmlDeclaration.php b/classes/PHPTAL/Dom/XmlDeclaration.php index 5e1b4a03..e28dfb9a 100644 --- a/classes/PHPTAL/Dom/XmlDeclaration.php +++ b/classes/PHPTAL/Dom/XmlDeclaration.php @@ -27,4 +27,3 @@ public function generateCode(PHPTAL_Php_CodeWriter $codewriter) $codewriter->doXmlDeclaration(); } } - diff --git a/classes/PHPTAL/IOException.php b/classes/PHPTAL/IOException.php index 5a67d00c..166290df 100644 --- a/classes/PHPTAL/IOException.php +++ b/classes/PHPTAL/IOException.php @@ -23,4 +23,3 @@ class PHPTAL_IOException extends PHPTAL_Exception { } - diff --git a/classes/PHPTAL/MacroMissingException.php b/classes/PHPTAL/MacroMissingException.php index e663c5fd..0e3a057c 100644 --- a/classes/PHPTAL/MacroMissingException.php +++ b/classes/PHPTAL/MacroMissingException.php @@ -22,4 +22,3 @@ class PHPTAL_MacroMissingException extends PHPTAL_TemplateException { } - diff --git a/classes/PHPTAL/ParserException.php b/classes/PHPTAL/ParserException.php index d530f72a..225ad546 100644 --- a/classes/PHPTAL/ParserException.php +++ b/classes/PHPTAL/ParserException.php @@ -22,4 +22,3 @@ class PHPTAL_ParserException extends PHPTAL_TemplateException { } - diff --git a/classes/PHPTAL/Php/Attribute/I18N/Attributes.php b/classes/PHPTAL/Php/Attribute/I18N/Attributes.php index 8428fbcf..96899a79 100644 --- a/classes/PHPTAL/Php/Attribute/I18N/Attributes.php +++ b/classes/PHPTAL/Php/Attribute/I18N/Attributes.php @@ -116,4 +116,3 @@ private function _getTranslationCode(PHPTAL_Php_CodeWriter $codewriter, $key) } } - diff --git a/classes/PHPTAL/Php/Attribute/I18N/Domain.php b/classes/PHPTAL/Php/Attribute/I18N/Domain.php index d472ed3f..b24ec430 100644 --- a/classes/PHPTAL/Php/Attribute/I18N/Domain.php +++ b/classes/PHPTAL/Php/Attribute/I18N/Domain.php @@ -48,4 +48,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter) } } - diff --git a/classes/PHPTAL/Php/Attribute/I18N/Translate.php b/classes/PHPTAL/Php/Attribute/I18N/Translate.php index 503b7ee1..cc61b6e9 100644 --- a/classes/PHPTAL/Php/Attribute/I18N/Translate.php +++ b/classes/PHPTAL/Php/Attribute/I18N/Translate.php @@ -128,4 +128,3 @@ private function _prepareNames(PHPTAL_Php_CodeWriter $codewriter, PHPTAL_Dom_Nod } } - diff --git a/classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php b/classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php index 1557bbc2..d0e9c9bd 100644 --- a/classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php +++ b/classes/PHPTAL/Php/Attribute/PHPTAL/Debug.php @@ -32,4 +32,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter) private $_oldMode; } - diff --git a/classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php b/classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php index 476a9750..f1fb4d74 100644 --- a/classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php +++ b/classes/PHPTAL/Php/Attribute/PHPTAL/Tales.php @@ -43,4 +43,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter) private $_oldMode; } - diff --git a/classes/PHPTAL/Php/Attribute/TAL/Comment.php b/classes/PHPTAL/Php/Attribute/TAL/Comment.php index 02bf8e35..4e5896ec 100644 --- a/classes/PHPTAL/Php/Attribute/TAL/Comment.php +++ b/classes/PHPTAL/Php/Attribute/TAL/Comment.php @@ -28,4 +28,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter) } } - diff --git a/classes/PHPTAL/Php/Attribute/TAL/Condition.php b/classes/PHPTAL/Php/Attribute/TAL/Condition.php index 0859d486..fc016f92 100644 --- a/classes/PHPTAL/Php/Attribute/TAL/Condition.php +++ b/classes/PHPTAL/Php/Attribute/TAL/Condition.php @@ -91,4 +91,3 @@ public function talesChainDefaultKeyword(PHPTAL_Php_TalesChainExecutor $executor } - diff --git a/classes/PHPTAL/Php/Attribute/TAL/OmitTag.php b/classes/PHPTAL/Php/Attribute/TAL/OmitTag.php index a0f5d481..7901119c 100644 --- a/classes/PHPTAL/Php/Attribute/TAL/OmitTag.php +++ b/classes/PHPTAL/Php/Attribute/TAL/OmitTag.php @@ -68,4 +68,3 @@ public function after(PHPTAL_Php_CodeWriter $codewriter) } } - diff --git a/classes/PHPTAL/Php/CodeWriter.php b/classes/PHPTAL/Php/CodeWriter.php index c626381b..3fb7ae5f 100644 --- a/classes/PHPTAL/Php/CodeWriter.php +++ b/classes/PHPTAL/Php/CodeWriter.php @@ -494,4 +494,3 @@ private function popCodeWriterContext() private $_xmldeclaration = ""; } - diff --git a/classes/PHPTAL/Php/Transformer.php b/classes/PHPTAL/Php/Transformer.php index 443779bb..c07608d6 100644 --- a/classes/PHPTAL/Php/Transformer.php +++ b/classes/PHPTAL/Php/Transformer.php @@ -416,4 +416,3 @@ private static function isVarNameChar($c) ); } - diff --git a/classes/PHPTAL/PreFilter/Compress.php b/classes/PHPTAL/PreFilter/Compress.php index 8a9665c9..6cc767cf 100644 --- a/classes/PHPTAL/PreFilter/Compress.php +++ b/classes/PHPTAL/PreFilter/Compress.php @@ -121,7 +121,7 @@ function filterDOM(PHPTAL_Dom_Element $root) // tal:content may replace element with something without space if (!$breaks_line && $root->getAttributeNS('http://xml.zope.org/namespaces/tal','content')) { $this->had_space = false; - + $this->most_recent_text_node = null; } // line break caused by end tag @@ -208,10 +208,10 @@ protected function normalizeAttributes(PHPTAL_Dom_Element $element) $attrs_by_qname[$attrnode->getQualifiedName()] = $attrnode; } - if (count($attrs_by_qname) > 1) { - uksort($attrs_by_qname, array($this, 'compareQNames')); - $element->setAttributeNodes(array_values($attrs_by_qname)); - } + if (count($attrs_by_qname) > 1) { + uksort($attrs_by_qname, array($this, 'compareQNames')); + $element->setAttributeNodes(array_values($attrs_by_qname)); + } } /** diff --git a/classes/PHPTAL/TalesRegistry.php b/classes/PHPTAL/TalesRegistry.php index f7d0a8f8..efcd76b1 100644 --- a/classes/PHPTAL/TalesRegistry.php +++ b/classes/PHPTAL/TalesRegistry.php @@ -47,7 +47,7 @@ protected function __construct() $this->registerPrefix('exists', array('PHPTAL_Php_TalesInternal', 'exists')); $this->registerPrefix('number', array('PHPTAL_Php_TalesInternal', 'number')); $this->registerPrefix('true', array('PHPTAL_Php_TalesInternal', 'true')); - + // these are added as fallbacks $this->registerPrefix('json', array('PHPTAL_Php_TalesInternal', 'json'), true); $this->registerPrefix('urlencode', array('PHPTAL_Php_TalesInternal', 'urlencode'), true); @@ -109,7 +109,7 @@ public function isRegistered($prefix) } private function findUnregisteredCallback($typePrefix) - { + { // class method if (strpos($typePrefix, '.')) { $classCallback = explode('.', $typePrefix, 2); @@ -135,7 +135,7 @@ private function findUnregisteredCallback($typePrefix) if (function_exists($func)) { return $func; } - + return NULL; } @@ -149,14 +149,14 @@ public function getCallback($prefix) if ($this->isRegistered($prefix) && !$this->_callbacks[$prefix]['is_fallback']) { return $this->_callbacks[$prefix]['callback']; } - + if ($callback = $this->findUnregisteredCallback($prefix)) { return $callback; } - + if ($this->isRegistered($prefix)) { return $this->_callbacks[$prefix]['callback']; - } + } return NULL; } diff --git a/doc/Makefile b/doc/Makefile index cae215ea..3ebebe48 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,12 +36,12 @@ onepageperchapter: $(XHTMLFILES) output_dir allononepage: $(XHTMLNOCHUNKSFILES) output_dir cp -p -- "$(XHTMLNOCHUNKSFILES)" "$(BUILD)/" - + plaintext: $(TXTFILES) output_dir cp -p -- "$(TXTFILES)" "$(BUILD)/phptal.txt" output_dir: - @test -d "$(BUILD)/split" || mkdir -p -- "$(BUILD)/split" + @test -d "$(BUILD)/split" || mkdir -p -- "$(BUILD)/split" # create temp output directory for current language $(TEMP): diff --git a/doc/en/book.xml b/doc/en/book.xml index 4d270172..b51fb95d 100644 --- a/doc/en/book.xml +++ b/doc/en/book.xml @@ -21,7 +21,7 @@ AntonAndriyevskyy Valeriyevich
x.meglio@gmail.com
- + @@ -486,14 +486,14 @@ catch (Exception $e){ Each definition may start with global keyword which makes variable available everywhere later in the template and all macros. Global variables can be redefined. - +

]]> - - On the contrary, a local variable is only available inside the element it is defined in (and inside macros that are called in this element): - + + On the contrary, a local variable is only available inside the element it is defined in (and inside macros that are called in this element): + - +

]]> @@ -2003,11 +2003,11 @@ echo $phptal->execute(); <methodname>addPreFilter()</methodname> method In PHPTAL 1.2.1 this method replaced older setPreFilter() method, which is now deprecated. - + Adds new pre filter that will be applied to the template. Pre filters can modify source code and parsed DOM nodes of the template. Pre filters are applied in other they've been set. - + See description of PHPTAL_PreFilter for more information how to write your own pre filter. - + @@ -2017,19 +2017,19 @@ echo $phptal->execute(); Pre filters are executed only once before template is compiled. Pre filters operate on template's source code, so they are not able to access value of any template variables. However pre filters can "see" and modify TAL markup. - + To create pre filter extend PHPTAL_PreFilter class and implement only filter*() methods you need. - + <methodname>filter()</methodname> Receives template source code as string and is expected to return new source. You can use it to simply find'n'replace fragments of source code. Be careful not to introduce syntax errors in the template. - + PHPTAL's error messages will refer to line numbers after filtering, which may be confusing if your prefilter adds or remove lines from the source code. - + <methodname>filterDOM()</methodname> Receives root PHPTAL DOM node of parsed file and should edit it in place. - + Example pre filter that removes all comments: execute(); } ]]> - - + + <methodname>getCacheId()</methodname> Should return (any) string that uniquely identifies this filter and its settings, which is used to (in)validate template cache. Each time you return different string, template will be recompiled. Implement this method if result of the filter depends on its configuration. - + Unlike other filter methods, this one is called on every execution. - - + + When developing and testing your filter, set setForceReparse(true) to force PHPTAL to update templates every time. Otherwise result of your filter will be cached and you won't see the changes. - + <methodname>getPHPTAL()</methodname> Returns instance of PHPTAL class that uses this prefilter. You can query it to check current encoding or other settings. - + - +

PHPTAL DOM Internally PHPTAL represents documents using it's own document object model, a little bit similar to W3C's DOM. However, PHPTAL's API has only few basic methods for DOM manipulation. - + PHPTAL_Dom_Element class has following properties and methods: - + arraychildNodes Numerically indexed array containing children of the element. Please don't edit this array directly. Use appendChild(), etc. - + PHPTAL does not implement nextSibling, firstChild, etc. - + - + PHPTAL_Dom_ElementparentNode Parent node (element) of the current element. Use it to traverse tree upwards. - + - + appendChild$node Appends node to the element. Node will be removed from its current element and added at the end of this element. PHPTAL does not manage namespace declarations. Moving nodes between elements in different namespaces will change meaning of the document. replaceChild$new_node $old_node Old node will be replaced with new node. - + removeChild$node Remove node from its parent. - + - + string getAttributeNS$namespace_uri $local_name Returns unescaped (without entities) value of a specific attribute. $a->getAttributeNS('','href') In XML attributes don't inherit element's namespace, and all XHTML attributes are in the default namespace. - + - + arraygetAttributeNodes Returns array of PHPTAL_Dom_Attr objects, which represent all element's attributes. You can modify attributes' values without using setAttributeNodes(). - + - + setAttributeNodes array$attrs Replaces all elements attributes with the given ones. - + stringgetLocalName Returns local name of the element, e.g. <atom:title> has local name title. - + stringgetNamespaceURI Returns namespace URI of the the element, e.g. <atom:title xmlns="http://www.w3.org/2005/Atom"> has namespace http://www.w3.org/2005/Atom. XHTML namespace is http://www.w3.org/1999/xhtml. - + Text, CDATA and attribute nodes have getValueEscaped() and setValueEscaped() methods which allow reading/setting of their text with entities preserved. @@ -2132,7 +2132,7 @@ echo $phptal->execute(); interface <classname>PHPTAL_Filter</classname> - This interface allows you to create filters for processing result of template execution. Post filters are set using setPostFilter() method. + This interface allows you to create filters for processing result of template execution. Post filters are set using setPostFilter() method. diff --git a/doc/ru/book.xml b/doc/ru/book.xml index 2e191bb9..23fb12b5 100644 --- a/doc/ru/book.xml +++ b/doc/ru/book.xml @@ -21,7 +21,7 @@ АнтонАндриевский Валериевич
x.meglio@gmail.com
- + @@ -419,7 +419,7 @@ catch (Exception $e){ ]]> Кстати, в этом примере мы не использовали слово 'global' перед определением переменной. В PHPTAL переменные бывают глобальными и локальными. - + Глобальная переменная будет доступна во всем шаблоне и в вызываемых из него макросов. diff --git a/tests/ArrayOverloadTest.php b/tests/ArrayOverloadTest.php index bc0a409e..66371802 100644 --- a/tests/ArrayOverloadTest.php +++ b/tests/ArrayOverloadTest.php @@ -64,4 +64,3 @@ function testIt() } } - diff --git a/tests/GetTextTest.php b/tests/GetTextTest.php index 141af3ba..8d7777ab 100644 --- a/tests/GetTextTest.php +++ b/tests/GetTextTest.php @@ -161,4 +161,3 @@ function testQuote() } } - diff --git a/tests/HTMLGeneratorTest.php b/tests/HTMLGeneratorTest.php index acd1fd59..e1f3c8d8 100644 --- a/tests/HTMLGeneratorTest.php +++ b/tests/HTMLGeneratorTest.php @@ -35,4 +35,3 @@ function testPHPConsumesNewline() } } - diff --git a/tests/Latin1Test.php b/tests/Latin1Test.php index 3c4edc1b..b34b8b50 100644 --- a/tests/Latin1Test.php +++ b/tests/Latin1Test.php @@ -40,4 +40,3 @@ function testDead() test%88ing'))->execute(); } } - diff --git a/tests/MetalSlotTest.php b/tests/MetalSlotTest.php index 50f88960..74f90935 100644 --- a/tests/MetalSlotTest.php +++ b/tests/MetalSlotTest.php @@ -252,43 +252,43 @@ function testSlotBug() normalize_html('
page/value:
OK toplevel-filled page/value
page/valuebis:
OK subpage filled page/valuebis
'), normalize_html($tpl->execute()), $tpl->getCodePath()); } - + function testNestedSlots() { $tpl = $this->newPHPTAL()->setSource(' -
- - -
+
+ + +
- +
- - First Level - - - Second Level - - - - - - - + + First Level + + + Second Level + + + + + + +
'); $this->assertEquals(normalize_html('
-
- First Level -
- Second Level - -
- -
+
+ First Level +
+ Second Level + +
+ +
'), normalize_html($tpl->execute())); } diff --git a/tests/OldTest.php b/tests/OldTest.php index 37ea3622..1408532c 100644 --- a/tests/OldTest.php +++ b/tests/OldTest.php @@ -203,4 +203,3 @@ function phptal_tales_my_modifier( $arg, $nothrow ) return "strtoupper('$arg')"; } - diff --git a/tests/OverloadingTest.php b/tests/OverloadingTest.php index e0193fdc..288e2a0e 100644 --- a/tests/OverloadingTest.php +++ b/tests/OverloadingTest.php @@ -55,4 +55,3 @@ function test() } } - diff --git a/tests/PhpModeTest.php b/tests/PhpModeTest.php index d1e997d7..790ad7eb 100644 --- a/tests/PhpModeTest.php +++ b/tests/PhpModeTest.php @@ -35,4 +35,3 @@ function testInContent() } } - diff --git a/tests/PhptalIdTest.php b/tests/PhptalIdTest.php index 56149071..d25b01b5 100644 --- a/tests/PhptalIdTest.php +++ b/tests/PhptalIdTest.php @@ -67,4 +67,3 @@ function test01() } } - diff --git a/tests/PhptalPathTest.php b/tests/PhptalPathTest.php index bec7ae0c..8945bc44 100644 --- a/tests/PhptalPathTest.php +++ b/tests/PhptalPathTest.php @@ -83,4 +83,3 @@ function testDefinedButNullProperty() } } - diff --git a/tests/ReadableErrorTest.php b/tests/ReadableErrorTest.php index 4c0f322a..bf6b2dc1 100644 --- a/tests/ReadableErrorTest.php +++ b/tests/ReadableErrorTest.php @@ -119,4 +119,3 @@ function assertThrowsInLine($line, $file) } } - diff --git a/tests/TalAttributesTest.php b/tests/TalAttributesTest.php index 72b5bdee..afc8c494 100644 --- a/tests/TalAttributesTest.php +++ b/tests/TalAttributesTest.php @@ -183,4 +183,3 @@ function phptal_tales_null($code, $nothrow) { return 'NULL'; } - diff --git a/tests/TalOnErrorTest.php b/tests/TalOnErrorTest.php index dc044dd5..e93605a3 100644 --- a/tests/TalOnErrorTest.php +++ b/tests/TalOnErrorTest.php @@ -61,4 +61,3 @@ function testReplaceStructure() } } - diff --git a/tests/TalRepeatTest.php b/tests/TalRepeatTest.php index adfe6e3c..f538551e 100644 --- a/tests/TalRepeatTest.php +++ b/tests/TalRepeatTest.php @@ -428,4 +428,3 @@ public function size() } } - diff --git a/tests/TalReplaceTest.php b/tests/TalReplaceTest.php index bd67a5e1..c6bd3b3a 100644 --- a/tests/TalReplaceTest.php +++ b/tests/TalReplaceTest.php @@ -100,4 +100,3 @@ function testEmpty() } } - diff --git a/tests/TalesIssetNullTest.php b/tests/TalesIssetNullTest.php index 98407b58..547ce86c 100644 --- a/tests/TalesIssetNullTest.php +++ b/tests/TalesIssetNullTest.php @@ -55,4 +55,3 @@ function testIt() } } - diff --git a/tests/TalesPhpWithReplaceTest.php b/tests/TalesPhpWithReplaceTest.php index 2666c41a..1302ad5b 100644 --- a/tests/TalesPhpWithReplaceTest.php +++ b/tests/TalesPhpWithReplaceTest.php @@ -25,4 +25,3 @@ function testIt() } } - diff --git a/tests/TalesRegistryTest.php b/tests/TalesRegistryTest.php index d909f255..60390859 100644 --- a/tests/TalesRegistryTest.php +++ b/tests/TalesRegistryTest.php @@ -20,14 +20,14 @@ function testInstance() $this->assertSame(PHPTAL_TalesRegistry::getInstance(), PHPTAL_TalesRegistry::getInstance()); $this->assertType('PHPTAL_TalesRegistry',PHPTAL_TalesRegistry::getInstance()); } - + function testRegisterFunction() { PHPTAL_TalesRegistry::getInstance()->registerPrefix('registry_test', 'registry_test_callback'); - + $this->assertEquals('

ok1

', $this->newPHPTAL()->setSource('

')->execute()); } - + /** * @expectedException PHPTAL_ConfigurationException */ @@ -38,7 +38,7 @@ function testCantRegisterNonExistant() /** * @expectedException PHPTAL_ConfigurationException - */ + */ function testCantRegisterTwice() { PHPTAL_TalesRegistry::getInstance()->registerPrefix('registry_test_3', 'registry_test_callback'); diff --git a/tests/TalesTest.php b/tests/TalesTest.php index 06af5da3..8e153fa9 100644 --- a/tests/TalesTest.php +++ b/tests/TalesTest.php @@ -83,7 +83,7 @@ function testTrue() $res = $tpl->execute(); $this->assertEquals(normalize_html_file('output/tales-true.html'), normalize_html($res)); } - + function testJSON() { $this->assertEquals('

{"foo":"bar"}

', $this->newPHPTAL()->setSource('

')->execute()); diff --git a/tests/input/error-04.html b/tests/input/error-04.html index 6f9849b0..3a646823 100644 --- a/tests/input/error-04.html +++ b/tests/input/error-04.html @@ -5,4 +5,3 @@ line"> - diff --git a/tests/input/error-05.html b/tests/input/error-05.html index 04928304..8c52b514 100644 --- a/tests/input/error-05.html +++ b/tests/input/error-05.html @@ -5,4 +5,3 @@ - diff --git a/tests/input/error-06.html b/tests/input/error-06.html index 16b6a6d9..3509107d 100644 --- a/tests/input/error-06.html +++ b/tests/input/error-06.html @@ -5,4 +5,3 @@ ${idontexist} - diff --git a/tests/input/error-07.html b/tests/input/error-07.html index a326d638..ba6708e6 100644 --- a/tests/input/error-07.html +++ b/tests/input/error-07.html @@ -6,4 +6,3 @@ href="${a_number/idontexist}" /> - diff --git a/tests/input/error-08.html b/tests/input/error-08.html index d5f92d94..aa1c88e0 100644 --- a/tests/input/error-08.html +++ b/tests/input/error-08.html @@ -9,4 +9,3 @@ - diff --git a/tests/input/error-09.html b/tests/input/error-09.html index d2939442..2e4d8df7 100644 --- a/tests/input/error-09.html +++ b/tests/input/error-09.html @@ -7,4 +7,3 @@ ]]> - diff --git a/tests/input/error-10.html b/tests/input/error-10.html index 02666b19..700eeb2a 100644 --- a/tests/input/error-10.html +++ b/tests/input/error-10.html @@ -4,4 +4,3 @@ - diff --git a/tests/input/error-11.html b/tests/input/error-11.html index a52d75f6..ea8be69e 100644 --- a/tests/input/error-11.html +++ b/tests/input/error-11.html @@ -1,3 +1,2 @@ ${#:?} - diff --git a/tests/input/error-13.html b/tests/input/error-13.html index 04d0a5a4..e1ed8ad7 100644 --- a/tests/input/error-13.html +++ b/tests/input/error-13.html @@ -3,4 +3,3 @@ "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - diff --git a/tests/input/old-17.html b/tests/input/old-17.html index edcf8c33..b2b8230a 100644 --- a/tests/input/old-17.html +++ b/tests/input/old-17.html @@ -1,7 +1,7 @@ Test expression with strange indentation :