Index: tests/t3lib/t3lib_pagerenderer_testcase.php
===================================================================
--- tests/t3lib/t3lib_pagerenderer_testcase.php (revision 6606)
+++ tests/t3lib/t3lib_pagerenderer_testcase.php (working copy)
@@ -39,6 +39,7 @@
public function setUp() {
$this->fixture = new t3lib_PageRenderer();
+ $this->fixture->setCharSet('utf-8');
}
public function tearDown() {
@@ -60,17 +61,17 @@
$this->fixture instanceof t3lib_PageRenderer
);
}
-
+
//////////////////////
// test functions
//////////////////////
/**
* test set xml prolog and doctype
- *
+ *
*/
public function testSetXmlPrologAndDocType() {
-
+
$expectedReturnValue = '';
$this->fixture->setXmlPrologAndDocType('');
$out = $this->fixture->render();
@@ -83,10 +84,10 @@
/**
* test set title
- *
+ *
*/
public function testSetTitle() {
-
+
$expectedReturnValue = '
This is the title';
$this->fixture->setTitle('This is the title');
$out = $this->fixture->render();
@@ -99,10 +100,10 @@
/**
* test set charset
- *
+ *
*/
public function testSetCharset() {
-
+
$expectedReturnValue = '';
$this->fixture->setCharset('utf-8');
$out = $this->fixture->render();
@@ -115,10 +116,10 @@
/**
* test set favicon
- *
+ *
*/
public function testSetFavIcon() {
-
+
$expectedReturnValue1 = '';
$expectedReturnValue2 = '';
$this->fixture->setFavIcon('http://google.com/favicon.ico');
@@ -132,15 +133,15 @@
$expectedReturnValue2,
$out
);
-
+
}
/**
* test set baseUrl
- *
+ *
*/
public function testSetBaseUrl() {
-
+
$expectedReturnValue = '';
$this->fixture->setBaseUrl('http://ggogle.com/');
$out = $this->fixture->render();
@@ -153,10 +154,10 @@
/**
* test add meta tag
- *
+ *
*/
public function testAddMetaTag() {
-
+
$expectedReturnValue = '';
$this->fixture->addMetaTag('');
$out = $this->fixture->render();
@@ -169,10 +170,10 @@
/**
* test add inline comment
- *
+ *
*/
public function testAddInlineComment() {
-
+
$expectedReturnValue = 'this is an inline comment written by unit test';
$this->fixture->addInlineComment('this is an inline comment written by unit test');
$out = $this->fixture->render();
@@ -185,10 +186,10 @@
/**
* test add header data
- *
+ *
*/
public function testAddHeaderData() {
-
+
$expectedReturnValue = '';
$this->fixture->addHeaderData('');
$out = $this->fixture->render();
@@ -201,10 +202,10 @@
/**
* test add footer data
- *
+ *
*/
public function testAddFooterData() {
-
+
$expectedReturnValue = '';
$this->fixture->addFooterData('');
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
@@ -217,10 +218,10 @@
/**
* test add JS library file
- *
+ *
*/
public function testAddJsLibrary() {
-
+
$expectedReturnValue = '';
$this->fixture->addJsLibrary('test', 'fileadmin/test.js');
$out = $this->fixture->render();
@@ -230,14 +231,14 @@
$out
);
}
-
-
+
+
/**
* test add JS footer library file
- *
+ *
*/
public function testAddJsFooterLibrary() {
-
+
$expectedReturnValue = '';
$this->fixture->addJsFooterLibrary('test', 'fileadmin/test.js');
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
@@ -250,10 +251,10 @@
/**
* test add JS file
- *
+ *
*/
public function testAddJsFile() {
-
+
$expectedReturnValue = '';
$this->fixture->addJsFile('fileadmin/test.js');
$out = $this->fixture->render();
@@ -266,10 +267,10 @@
/**
* test add JS file for footer
- *
+ *
*/
public function testAddJsFooterFile() {
-
+
$expectedReturnValue = '';
$this->fixture->addJsFooterFile('fileadmin/test.js');
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
@@ -282,10 +283,10 @@
/**
* test add JS inline
- *
+ *
*/
public function testAddJsInlineCode() {
-
+
$expectedReturnValue = 'var x = "testvar"';
$this->fixture->addJsInlineCode('test', 'var x = "testvar"');
$out = $this->fixture->render();
@@ -298,10 +299,10 @@
/**
* test add JS inline for footer
- *
+ *
*/
public function testAddJsFooterInlineCode() {
-
+
$expectedReturnValue = 'var x = "testvar"';
$this->fixture->addJsFooterInlineCode('test', 'var x = "testvar"');
$out = $this->fixture->render(t3lib_PageRenderer::PART_FOOTER);
@@ -314,10 +315,10 @@
/**
* test add JS handler
- *
+ *
*/
public function testAddExtOnReadyCode() {
-
+
$expectedReturnValue1 = 'Ext.onReady(function() {';
$expectedReturnValue2 = 'var x = "testvar";';
$this->fixture->loadExtJS();
@@ -328,20 +329,20 @@
$expectedReturnValue1,
$out
);
-
+
$this->assertContains(
$expectedReturnValue2,
$out
);
-
+
}
/**
* test add CSS file
- *
+ *
*/
public function testAddCssFile() {
-
+
$expectedReturnValue = '';
$this->fixture->addCssFile('fileadmin/test.css');
$out = $this->fixture->render();
@@ -354,10 +355,10 @@
/**
* test add CSS inline
- *
+ *
*/
public function testAddCssInlineBlock() {
-
+
$expectedReturnValue = 'body {margin:20px;}';
$this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');
$out = $this->fixture->render();
@@ -370,10 +371,10 @@
/**
* test add CSS inline and force on top
- *
+ *
*/
public function testAddCssInlineBlockForceOnTop() {
-
+
$expectedReturnValue = '/*general1*/' . chr(10) . 'h1 {margin:20px;}' . chr(10) . '/*general*/' . chr(10) . 'body {margin:20px;}';
$this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');
$this->fixture->addCssInlineBlock('general1', 'h1 {margin:20px;}', NULL, TRUE);
@@ -387,10 +388,10 @@
/**
* test load prototype
- *
+ *
*/
public function testLoadPrototype() {
-
+
$expectedReturnValue = '';
$this->fixture->loadPrototype();
$out = $this->fixture->render();
@@ -403,10 +404,10 @@
/**
* test load Scriptaculous
- *
+ *
*/
public function testLoadScriptaculous() {
-
+
$expectedReturnValue = '';
$this->fixture->loadScriptaculous('slider,controls');
$out = $this->fixture->render();
@@ -419,10 +420,10 @@
/**
* test load ExtJS
- *
+ *
*/
public function testLoadExtJS() {
-
+
$expectedReturnValue = '' . chr(10) . '';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$out = $this->fixture->render();
@@ -432,13 +433,13 @@
$out
);
}
-
+
/**
* test load ExtCore
- *
+ *
*/
public function testLoadExtCore() {
-
+
$expectedReturnValue = '';
$this->fixture->loadExtCore();
$out = $this->fixture->render();
@@ -448,13 +449,13 @@
$out
);
}
-
+
/**
- * test enable ExtJsDebug
- *
+ * test enable ExtJsDebug
+ *
*/
public function testEnableExtJsDebug() {
-
+
$expectedReturnValue = '' . chr(10) . '';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$this->fixture->enableExtJsDebug();
@@ -465,13 +466,13 @@
$out
);
}
-
+
/**
* test enable ExtCoreDebug
- *
+ *
*/
- public function testEnableExtCoreDebug() {
-
+ public function testEnableExtCoreDebug() {
+
$expectedReturnValue = '';
$this->fixture->loadExtCore();
$this->fixture->enableExtCoreDebug();
@@ -482,13 +483,13 @@
$out
);
}
-
+
/**
* test inline language label
- *
+ *
*/
public function testAddInlineLanguageLabel() {
-
+
$expectedReturnValue = 'TYPO3.lang = {"myKey":"myValue"}';
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabel('myKey', 'myValue');
@@ -500,13 +501,13 @@
$out
);
}
-
+
/**
* test inline language label as array
- *
+ *
*/
public function testAddInlineLanguageLabelArray() {
-
+
$expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));
@@ -518,13 +519,13 @@
$out
);
}
-
+
/**
* test inline language label as array get merged
- *
+ *
*/
public function testAddInlineLanguageLabelArrayMerged() {
-
+
$expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}';
$this->fixture->loadExtJS();
$this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1',));
@@ -537,13 +538,13 @@
$out
);
}
-
+
/**
* test inline setting
- *
+ *
*/
public function testAddInlineSetting() {
-
+
$expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey":"myValue"}};';
$this->fixture->loadExtJS();
$this->fixture->addInlineSetting('myApp', 'myKey', 'myValue');
@@ -555,13 +556,13 @@
$out
);
}
-
+
/**
* test inline settings with array
- *
+ *
*/
public function testAddInlineSettingArray() {
-
+
$expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';
$this->fixture->loadExtJS();
$this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1', 'myKey2' => 'myValue2',));
@@ -573,13 +574,13 @@
$out
);
}
-
+
/**
* test inline settings with array get merged
- *
+ *
*/
public function testAddInlineSettingArrayMerged() {
-
+
$expectedReturnValue = 'TYPO3.settings = {"myApp":{"myKey1":"myValue1","myKey2":"myValue2"}};';
$this->fixture->loadExtJS();
$this->fixture->addInlineSettingArray('myApp', array('myKey1' => 'myValue1',));
@@ -592,10 +593,10 @@
$out
);
}
-
+
/**
* test add body content
- *
+ *
*/
public function testAddBodyContent() {
$expectedReturnValue = 'ABCDE';
@@ -604,29 +605,29 @@
$this->fixture->addBodyContent('C');
$this->fixture->addBodyContent('D');
$this->fixture->addBodyContent('E');
-
+
$out = $this->fixture->getBodyContent();
$this->assertEquals(
$expectedReturnValue,
$out
);
}
-
-
+
+
/**
* test set body content
- *
+ *
*/
public function testSetBodyContent() {
$expectedReturnValue = 'ABCDE';
$this->fixture->setBodyContent('ABCDE');
-
+
$out = $this->fixture->getBodyContent();
$this->assertEquals(
$expectedReturnValue,
$out
);
-
+
$out = $this->fixture->render();
$this->assertContains(