renamed testcase for t3lib_pageRenderer
authorSteffen Kamper <info@sk-typo3.de>
Mon, 7 Sep 2009 10:39:03 +0000 (10:39 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 7 Sep 2009 10:39:03 +0000 (10:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5908 709f56b5-9817-0410-a4d7-c38de5d9e867

tests/t3lib/t3lib_pagerender_testcase.php [deleted file]
tests/t3lib/t3lib_pagerenderer_testcase.php [new file with mode: 0644]

diff --git a/tests/t3lib/t3lib_pagerender_testcase.php b/tests/t3lib/t3lib_pagerender_testcase.php
deleted file mode 100644 (file)
index 80b3527..0000000
+++ /dev/null
@@ -1,650 +0,0 @@
-<?php\r
-/***************************************************************\r
-* Copyright notice\r
-*\r
-* (c) 2009 Steffen Kamper (info@sk-typo3.de)\r
-* All rights reserved\r
-*\r
-* This script is part of the TYPO3 project. The TYPO3 project is\r
-* free software; you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation; either version 2 of the License or\r
-* (at your option) any later version.\r
-*\r
-* The GNU General Public License can be found at\r
-* http://www.gnu.org/copyleft/gpl.html.\r
-*\r
-* This script is distributed in the hope that it will be useful\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* This copyright notice MUST APPEAR in all copies of the script!\r
-***************************************************************/\r
-\r
-\r
-/**\r
- * Testcase for the t3lib_pageIncludes class in the TYPO3 core.\r
- *\r
- * @package TYPO3\r
- * @subpackage t3lib\r
- *\r
- * @author Steffen Kamper (info@sk-typo3.de)\r
- */\r
-class t3lib_pageRenderer_testcase extends tx_phpunit_testcase {\r
-       /**\r
-        * @var t3lib_pageIncludes\r
-        */\r
-       private $fixture;\r
-\r
-       const PART_COMPLETE = 0;\r
-       const PART_HEADER = 1;\r
-       const PART_FOOTER = 2;\r
-\r
-       public function setUp() {\r
-               $className = 't3lib_pageRenderer_' . uniqid('test');\r
-               eval('\r
-                       class ' . $className . ' extends t3lib_pageRenderer {\r
-                       }\r
-               ');\r
-               $this->fixture = new $className();\r
-       }\r
-\r
-       public function tearDown() {\r
-               unset(\r
-                       $this->fixture\r
-               );\r
-       }\r
-\r
-\r
-       //////////////////////////////////////\r
-       // Tests for the basic functionality\r
-       //////////////////////////////////////\r
-\r
-       /**\r
-        * @test\r
-        */\r
-       public function fixtureCanBeCreated() {\r
-               $this->assertTrue(\r
-                       $this->fixture instanceof t3lib_pageRenderer\r
-               );\r
-       }\r
-       \r
-       //////////////////////\r
-       // test functions\r
-       //////////////////////\r
-\r
-       /**\r
-       * test set xml prolog and doctype\r
-       * \r
-       */\r
-       public function testSetXmlPrologAndDocType() {\r
-               \r
-               $expectedReturnValue = '<?xml version="1.0" encoding="utf-8" ?>';\r
-               $this->fixture->setXmlPrologAndDocType('<?xml version="1.0" encoding="utf-8" ?>');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test set title\r
-       * \r
-       */\r
-       public function testSetTitle() {\r
-               \r
-               $expectedReturnValue = '<title>This is the title</title>';\r
-               $this->fixture->setTitle('This is the title');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test set charset\r
-       * \r
-       */\r
-       public function testSetCharset() {\r
-               \r
-               $expectedReturnValue = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';\r
-               $this->fixture->setCharset('utf-8');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test set favicon\r
-       * \r
-       */\r
-       public function testSetFavIcon() {\r
-               \r
-               $expectedReturnValue1 = '<link rel="shortcut icon" href="http://google.com/favicon.ico" />';\r
-               $expectedReturnValue2 = '<link rel="icon" href="http://google.com/favicon.ico" />';\r
-               $this->fixture->setFavIcon('http://google.com/favicon.ico');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue1,\r
-                       $out\r
-               );\r
-               $this->assertContains(\r
-                       $expectedReturnValue2,\r
-                       $out\r
-               );\r
-               \r
-       }\r
-\r
-       /**\r
-       * test set baseUrl\r
-       * \r
-       */\r
-       public function testSetBaseUrl() {\r
-               \r
-               $expectedReturnValue = '<base href="http://ggogle.com/" />';\r
-               $this->fixture->setBaseUrl('http://ggogle.com/');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add meta tag\r
-       * \r
-       */\r
-       public function testAddMetaTag() {\r
-               \r
-               $expectedReturnValue = '<meta name="author" content="Anna Lyse">';\r
-               $this->fixture->addMetaTag('<meta name="author" content="Anna Lyse">');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add inline comment\r
-       * \r
-       */\r
-       public function testAddInlineComment() {\r
-               \r
-               $expectedReturnValue = 'this is an inline comment written by unit test';\r
-               $this->fixture->addInlineComment('this is an inline comment written by unit test');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add header data\r
-       * \r
-       */\r
-       public function testAddHeaderData() {\r
-               \r
-               $expectedReturnValue = '<tag method="private" name="test" />';\r
-               $this->fixture->addHeaderData('<tag method="private" name="test" />');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add footer data\r
-       * \r
-       */\r
-       public function testAddFooterData() {\r
-               \r
-               $expectedReturnValue = '<tag method="private" name="test" />';\r
-               $this->fixture->addFooterData('<tag method="private" name="test" />');\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS library file\r
-       * \r
-       */\r
-       public function testAddJsLibrary() {\r
-               \r
-               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
-               $this->fixture->addJsLibrary('test', 'fileadmin/test.js');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       \r
-       /**\r
-       * test add JS footer library file\r
-       * \r
-       */\r
-       public function testAddJsFooterLibrary() {\r
-               \r
-               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
-               $this->fixture->addJsFooterLibrary('test', 'fileadmin/test.js');\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS file\r
-       * \r
-       */\r
-       public function testAddJsFile() {\r
-               \r
-               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
-               $this->fixture->addJsFile('fileadmin/test.js');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS file for footer\r
-       * \r
-       */\r
-       public function testAddJsFooterFile() {\r
-               \r
-               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
-               $this->fixture->addJsFooterFile('fileadmin/test.js');\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS inline\r
-       * \r
-       */\r
-       public function testAddJsInlineCode() {\r
-               \r
-               $expectedReturnValue = 'var x = "testvar"';\r
-               $this->fixture->addJsInlineCode('test', 'var x = "testvar"');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS inline for footer\r
-       * \r
-       */\r
-       public function testAddJsFooterInlineCode() {\r
-               \r
-               $expectedReturnValue = 'var x = "testvar"';\r
-               $this->fixture->addJsFooterInlineCode('test', 'var x = "testvar"');\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add JS handler\r
-       * \r
-       */\r
-       public function testAddExtOnReadyCode() {\r
-               \r
-               $expectedReturnValue1 = 'Ext.onReady(function() {';\r
-               $expectedReturnValue2 = 'var x = "testvar";';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addExtOnReadyCode('var x = "testvar";');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue1,\r
-                       $out\r
-               );\r
-               \r
-               $this->assertContains(\r
-                       $expectedReturnValue2,\r
-                       $out\r
-               );\r
-               \r
-       }\r
-\r
-       /**\r
-       * test add CSS file\r
-       * \r
-       */\r
-       public function testAddCssFile() {\r
-               \r
-               $expectedReturnValue = '<link rel="stylesheet" type="text/css" href="fileadmin/test.css" media="screen" />';\r
-               $this->fixture->addCssFile('fileadmin/test.css');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add CSS inline\r
-       * \r
-       */\r
-       public function testAddCssInlineBlock() {\r
-               \r
-               $expectedReturnValue = 'body {margin:20px;}';\r
-               $this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test add CSS inline and force on top\r
-       * \r
-       */\r
-       public function testAddCssInlineBlockForceOnTop() {\r
-               \r
-               $expectedReturnValue = '/*general1*/' . chr(10) . 'h1 {margin:20px;}' . chr(10) . '/*general*/' . chr(10) . 'body {margin:20px;}';\r
-               $this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');\r
-               $this->fixture->addCssInlineBlock('general1', 'h1 {margin:20px;}', NULL, TRUE);\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-    /**\r
-    * test load prototype\r
-    * \r
-    */\r
-       public function testLoadPrototype() {\r
-               \r
-               $expectedReturnValue = '<script src="contrib/prototype/prototype.js" type="text/javascript"></script>';\r
-               $this->fixture->loadPrototype();\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test load Scriptaculous\r
-       * \r
-       */\r
-       public function testLoadScriptaculous() {\r
-               \r
-               $expectedReturnValue = '<script src="contrib/scriptaculous/scriptaculous.js?load=effects,controls,slider" type="text/javascript"></script>';\r
-               $this->fixture->loadScriptaculous('slider,controls');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-\r
-       /**\r
-       * test load ExtJS\r
-       * \r
-       */\r
-    public function testLoadExtJS() {\r
-               \r
-               $expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all.js" type="text/javascript"></script>';\r
-               $this->fixture->loadExtJS(TRUE, TRUE, 'jquery');\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test load ExtCore\r
-       * \r
-       */\r
-       public function testLoadExtCore() {\r
-               \r
-               $expectedReturnValue = '<script src="contrib/extjs/ext-core.js" type="text/javascript"></script>';\r
-               $this->fixture->loadExtCore();\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test enable ExtJsDebug  \r
-       * \r
-       */\r
-       public function testEnableExtJsDebug() {\r
-               \r
-               $expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all-debug.js" type="text/javascript"></script>';\r
-               $this->fixture->loadExtJS(TRUE, TRUE, 'jquery');\r
-               $this->fixture->enableExtJsDebug();\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test enable ExtCoreDebug\r
-       * \r
-       */\r
-       public function testEnableExtCoreDebug() {      \r
-               \r
-               $expectedReturnValue = '<script src="contrib/extjs/ext-core-debug.js" type="text/javascript"></script>';\r
-               $this->fixture->loadExtCore();\r
-               $this->fixture->enableExtCoreDebug();\r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline language label\r
-       * \r
-       */\r
-       public function testAddInlineLanguageLabel() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.lang = {"myKey":"myValue"}';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineLanguageLabel('myKey', 'myValue');\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline language label as array\r
-       * \r
-       */\r
-       public function testAddInlineLanguageLabelArray() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline language label as array get merged\r
-       * \r
-       */\r
-       public function testAddInlineLanguageLabelArrayMerged() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1',));\r
-               $this->fixture->addInlineLanguageLabelArray(array('myKey2' => 'myValue2',));\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline setting\r
-       * \r
-       */\r
-       public function testAddInlineSetting() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey":"myValue"}};';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineSetting('myApp', 'myKey', 'myValue');\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline settings with array\r
-       * \r
-       */\r
-       public function testAddInlineSettingArray() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test inline settings with array get merged\r
-       * \r
-       */\r
-       public function testAddInlineSettingArrayMerged() {\r
-               \r
-               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';\r
-               $this->fixture->loadExtJS();\r
-               $this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1',));\r
-               $this->fixture->addInlineSettingArray('myApp', array('myKey2' => 'myValue2',));\r
-               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
-               $out = $this->fixture->render(self::PART_FOOTER);\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       /**\r
-       * test add body content\r
-       * \r
-       */\r
-       public function testAddBodyContent() {\r
-               $expectedReturnValue = 'ABCDE';\r
-               $this->fixture->addBodyContent('A');\r
-               $this->fixture->addBodyContent('B');\r
-               $this->fixture->addBodyContent('C');\r
-               $this->fixture->addBodyContent('D');\r
-               $this->fixture->addBodyContent('E');\r
-               \r
-               $out = $this->fixture->getBodyContent();\r
-               $this->assertEquals(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-       \r
-       /**\r
-       * test set body content\r
-       * \r
-       */\r
-       public function testSetBodyContent() {\r
-               $expectedReturnValue = 'ABCDE';\r
-               $this->fixture->setBodyContent('ABCDE');\r
-               \r
-               $out = $this->fixture->getBodyContent();\r
-               $this->assertEquals(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-               \r
-               $out = $this->fixture->render();\r
-\r
-               $this->assertContains(\r
-                       $expectedReturnValue,\r
-                       $out\r
-               );\r
-       }\r
-       \r
-  \r
-\r
-}\r
-?>
\ No newline at end of file
diff --git a/tests/t3lib/t3lib_pagerenderer_testcase.php b/tests/t3lib/t3lib_pagerenderer_testcase.php
new file mode 100644 (file)
index 0000000..80b3527
--- /dev/null
@@ -0,0 +1,650 @@
+<?php\r
+/***************************************************************\r
+* Copyright notice\r
+*\r
+* (c) 2009 Steffen Kamper (info@sk-typo3.de)\r
+* All rights reserved\r
+*\r
+* This script is part of the TYPO3 project. The TYPO3 project is\r
+* free software; you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation; either version 2 of the License or\r
+* (at your option) any later version.\r
+*\r
+* The GNU General Public License can be found at\r
+* http://www.gnu.org/copyleft/gpl.html.\r
+*\r
+* This script is distributed in the hope that it will be useful\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+* GNU General Public License for more details.\r
+*\r
+* This copyright notice MUST APPEAR in all copies of the script!\r
+***************************************************************/\r
+\r
+\r
+/**\r
+ * Testcase for the t3lib_pageIncludes class in the TYPO3 core.\r
+ *\r
+ * @package TYPO3\r
+ * @subpackage t3lib\r
+ *\r
+ * @author Steffen Kamper (info@sk-typo3.de)\r
+ */\r
+class t3lib_pageRenderer_testcase extends tx_phpunit_testcase {\r
+       /**\r
+        * @var t3lib_pageIncludes\r
+        */\r
+       private $fixture;\r
+\r
+       const PART_COMPLETE = 0;\r
+       const PART_HEADER = 1;\r
+       const PART_FOOTER = 2;\r
+\r
+       public function setUp() {\r
+               $className = 't3lib_pageRenderer_' . uniqid('test');\r
+               eval('\r
+                       class ' . $className . ' extends t3lib_pageRenderer {\r
+                       }\r
+               ');\r
+               $this->fixture = new $className();\r
+       }\r
+\r
+       public function tearDown() {\r
+               unset(\r
+                       $this->fixture\r
+               );\r
+       }\r
+\r
+\r
+       //////////////////////////////////////\r
+       // Tests for the basic functionality\r
+       //////////////////////////////////////\r
+\r
+       /**\r
+        * @test\r
+        */\r
+       public function fixtureCanBeCreated() {\r
+               $this->assertTrue(\r
+                       $this->fixture instanceof t3lib_pageRenderer\r
+               );\r
+       }\r
+       \r
+       //////////////////////\r
+       // test functions\r
+       //////////////////////\r
+\r
+       /**\r
+       * test set xml prolog and doctype\r
+       * \r
+       */\r
+       public function testSetXmlPrologAndDocType() {\r
+               \r
+               $expectedReturnValue = '<?xml version="1.0" encoding="utf-8" ?>';\r
+               $this->fixture->setXmlPrologAndDocType('<?xml version="1.0" encoding="utf-8" ?>');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test set title\r
+       * \r
+       */\r
+       public function testSetTitle() {\r
+               \r
+               $expectedReturnValue = '<title>This is the title</title>';\r
+               $this->fixture->setTitle('This is the title');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test set charset\r
+       * \r
+       */\r
+       public function testSetCharset() {\r
+               \r
+               $expectedReturnValue = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';\r
+               $this->fixture->setCharset('utf-8');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test set favicon\r
+       * \r
+       */\r
+       public function testSetFavIcon() {\r
+               \r
+               $expectedReturnValue1 = '<link rel="shortcut icon" href="http://google.com/favicon.ico" />';\r
+               $expectedReturnValue2 = '<link rel="icon" href="http://google.com/favicon.ico" />';\r
+               $this->fixture->setFavIcon('http://google.com/favicon.ico');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue1,\r
+                       $out\r
+               );\r
+               $this->assertContains(\r
+                       $expectedReturnValue2,\r
+                       $out\r
+               );\r
+               \r
+       }\r
+\r
+       /**\r
+       * test set baseUrl\r
+       * \r
+       */\r
+       public function testSetBaseUrl() {\r
+               \r
+               $expectedReturnValue = '<base href="http://ggogle.com/" />';\r
+               $this->fixture->setBaseUrl('http://ggogle.com/');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add meta tag\r
+       * \r
+       */\r
+       public function testAddMetaTag() {\r
+               \r
+               $expectedReturnValue = '<meta name="author" content="Anna Lyse">';\r
+               $this->fixture->addMetaTag('<meta name="author" content="Anna Lyse">');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add inline comment\r
+       * \r
+       */\r
+       public function testAddInlineComment() {\r
+               \r
+               $expectedReturnValue = 'this is an inline comment written by unit test';\r
+               $this->fixture->addInlineComment('this is an inline comment written by unit test');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add header data\r
+       * \r
+       */\r
+       public function testAddHeaderData() {\r
+               \r
+               $expectedReturnValue = '<tag method="private" name="test" />';\r
+               $this->fixture->addHeaderData('<tag method="private" name="test" />');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add footer data\r
+       * \r
+       */\r
+       public function testAddFooterData() {\r
+               \r
+               $expectedReturnValue = '<tag method="private" name="test" />';\r
+               $this->fixture->addFooterData('<tag method="private" name="test" />');\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS library file\r
+       * \r
+       */\r
+       public function testAddJsLibrary() {\r
+               \r
+               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
+               $this->fixture->addJsLibrary('test', 'fileadmin/test.js');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       \r
+       /**\r
+       * test add JS footer library file\r
+       * \r
+       */\r
+       public function testAddJsFooterLibrary() {\r
+               \r
+               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
+               $this->fixture->addJsFooterLibrary('test', 'fileadmin/test.js');\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS file\r
+       * \r
+       */\r
+       public function testAddJsFile() {\r
+               \r
+               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
+               $this->fixture->addJsFile('fileadmin/test.js');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS file for footer\r
+       * \r
+       */\r
+       public function testAddJsFooterFile() {\r
+               \r
+               $expectedReturnValue = '<script src="fileadmin/test.js" type="text/javascript"></script>';\r
+               $this->fixture->addJsFooterFile('fileadmin/test.js');\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS inline\r
+       * \r
+       */\r
+       public function testAddJsInlineCode() {\r
+               \r
+               $expectedReturnValue = 'var x = "testvar"';\r
+               $this->fixture->addJsInlineCode('test', 'var x = "testvar"');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS inline for footer\r
+       * \r
+       */\r
+       public function testAddJsFooterInlineCode() {\r
+               \r
+               $expectedReturnValue = 'var x = "testvar"';\r
+               $this->fixture->addJsFooterInlineCode('test', 'var x = "testvar"');\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add JS handler\r
+       * \r
+       */\r
+       public function testAddExtOnReadyCode() {\r
+               \r
+               $expectedReturnValue1 = 'Ext.onReady(function() {';\r
+               $expectedReturnValue2 = 'var x = "testvar";';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addExtOnReadyCode('var x = "testvar";');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue1,\r
+                       $out\r
+               );\r
+               \r
+               $this->assertContains(\r
+                       $expectedReturnValue2,\r
+                       $out\r
+               );\r
+               \r
+       }\r
+\r
+       /**\r
+       * test add CSS file\r
+       * \r
+       */\r
+       public function testAddCssFile() {\r
+               \r
+               $expectedReturnValue = '<link rel="stylesheet" type="text/css" href="fileadmin/test.css" media="screen" />';\r
+               $this->fixture->addCssFile('fileadmin/test.css');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add CSS inline\r
+       * \r
+       */\r
+       public function testAddCssInlineBlock() {\r
+               \r
+               $expectedReturnValue = 'body {margin:20px;}';\r
+               $this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test add CSS inline and force on top\r
+       * \r
+       */\r
+       public function testAddCssInlineBlockForceOnTop() {\r
+               \r
+               $expectedReturnValue = '/*general1*/' . chr(10) . 'h1 {margin:20px;}' . chr(10) . '/*general*/' . chr(10) . 'body {margin:20px;}';\r
+               $this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');\r
+               $this->fixture->addCssInlineBlock('general1', 'h1 {margin:20px;}', NULL, TRUE);\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+    /**\r
+    * test load prototype\r
+    * \r
+    */\r
+       public function testLoadPrototype() {\r
+               \r
+               $expectedReturnValue = '<script src="contrib/prototype/prototype.js" type="text/javascript"></script>';\r
+               $this->fixture->loadPrototype();\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test load Scriptaculous\r
+       * \r
+       */\r
+       public function testLoadScriptaculous() {\r
+               \r
+               $expectedReturnValue = '<script src="contrib/scriptaculous/scriptaculous.js?load=effects,controls,slider" type="text/javascript"></script>';\r
+               $this->fixture->loadScriptaculous('slider,controls');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+\r
+       /**\r
+       * test load ExtJS\r
+       * \r
+       */\r
+    public function testLoadExtJS() {\r
+               \r
+               $expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all.js" type="text/javascript"></script>';\r
+               $this->fixture->loadExtJS(TRUE, TRUE, 'jquery');\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test load ExtCore\r
+       * \r
+       */\r
+       public function testLoadExtCore() {\r
+               \r
+               $expectedReturnValue = '<script src="contrib/extjs/ext-core.js" type="text/javascript"></script>';\r
+               $this->fixture->loadExtCore();\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test enable ExtJsDebug  \r
+       * \r
+       */\r
+       public function testEnableExtJsDebug() {\r
+               \r
+               $expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . chr(10) . '<script src="contrib/extjs/ext-all-debug.js" type="text/javascript"></script>';\r
+               $this->fixture->loadExtJS(TRUE, TRUE, 'jquery');\r
+               $this->fixture->enableExtJsDebug();\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test enable ExtCoreDebug\r
+       * \r
+       */\r
+       public function testEnableExtCoreDebug() {      \r
+               \r
+               $expectedReturnValue = '<script src="contrib/extjs/ext-core-debug.js" type="text/javascript"></script>';\r
+               $this->fixture->loadExtCore();\r
+               $this->fixture->enableExtCoreDebug();\r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline language label\r
+       * \r
+       */\r
+       public function testAddInlineLanguageLabel() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.lang = {"myKey":"myValue"}';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineLanguageLabel('myKey', 'myValue');\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline language label as array\r
+       * \r
+       */\r
+       public function testAddInlineLanguageLabelArray() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline language label as array get merged\r
+       * \r
+       */\r
+       public function testAddInlineLanguageLabelArrayMerged() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1',));\r
+               $this->fixture->addInlineLanguageLabelArray(array('myKey2' => 'myValue2',));\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline setting\r
+       * \r
+       */\r
+       public function testAddInlineSetting() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey":"myValue"}};';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineSetting('myApp', 'myKey', 'myValue');\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline settings with array\r
+       * \r
+       */\r
+       public function testAddInlineSettingArray() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test inline settings with array get merged\r
+       * \r
+       */\r
+       public function testAddInlineSettingArrayMerged() {\r
+               \r
+               $expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';\r
+               $this->fixture->loadExtJS();\r
+               $this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1',));\r
+               $this->fixture->addInlineSettingArray('myApp', array('myKey2' => 'myValue2',));\r
+               $out = $this->fixture->enableMoveJsFromHeaderToFooter();\r
+               $out = $this->fixture->render(self::PART_FOOTER);\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       /**\r
+       * test add body content\r
+       * \r
+       */\r
+       public function testAddBodyContent() {\r
+               $expectedReturnValue = 'ABCDE';\r
+               $this->fixture->addBodyContent('A');\r
+               $this->fixture->addBodyContent('B');\r
+               $this->fixture->addBodyContent('C');\r
+               $this->fixture->addBodyContent('D');\r
+               $this->fixture->addBodyContent('E');\r
+               \r
+               $out = $this->fixture->getBodyContent();\r
+               $this->assertEquals(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+       \r
+       /**\r
+       * test set body content\r
+       * \r
+       */\r
+       public function testSetBodyContent() {\r
+               $expectedReturnValue = 'ABCDE';\r
+               $this->fixture->setBodyContent('ABCDE');\r
+               \r
+               $out = $this->fixture->getBodyContent();\r
+               $this->assertEquals(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+               \r
+               $out = $this->fixture->render();\r
+\r
+               $this->assertContains(\r
+                       $expectedReturnValue,\r
+                       $out\r
+               );\r
+       }\r
+       \r
+  \r
+\r
+}\r
+?>
\ No newline at end of file