Project

General

Profile

Bug #21143 » 12066-v6-tests.diff

Administrator Admin, 2010-04-12 13:16

View differences:

tests/t3lib/t3lib_pagerenderer_testcase.php (working copy)
*/
public function testAddCssInlineBlockForceOnTop() {
$expectedReturnValue = '/*general1*/' . chr(10) . 'h1 {margin:20px;}' . chr(10) . '/*general*/' . chr(10) . 'body {margin:20px;}';
$expectedReturnValue = '/*general1*/' . LF . 'h1 {margin:20px;}' . LF . '/*general*/' . LF . 'body {margin:20px;}';
$this->fixture->addCssInlineBlock('general', 'body {margin:20px;}');
$this->fixture->addCssInlineBlock('general1', 'h1 {margin:20px;}', NULL, TRUE);
$out = $this->fixture->render();
......
*/
public function testLoadExtJS() {
$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>';
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . LF . '<script src="contrib/extjs/ext-all.js" type="text/javascript"></script>';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$out = $this->fixture->render();
......
*/
public function testEnableExtJsDebug() {
$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>';
$expectedReturnValue = '<script src="contrib/extjs/adapter/jquery/ext-jquery-adapter.js" type="text/javascript"></script>' . LF . '<script src="contrib/extjs/ext-all-debug.js" type="text/javascript"></script>';
$this->fixture->loadExtJS(TRUE, TRUE, 'jquery');
$this->fixture->enableExtJsDebug();
$out = $this->fixture->render();
tests/t3lib/t3lib_div_testcase.php (working copy)
* @test
*/
public function checkTrimExplodeRemovesNewLines() {
$testString = ' a , b , ' . chr(10) . ' ,d ,, e,f,';
$testString = ' a , b , ' . LF . ' ,d ,, e,f,';
$expectedArray = array('a', 'b', 'd', 'e', 'f');
$actualArray = t3lib_div::trimExplode(',', $testString, true);
......
public function quoteJSvalueEscapesTab() {
$this->assertEquals(
"'" . '\t' . "'",
t3lib_div::quoteJSvalue(chr(9))
t3lib_div::quoteJSvalue(TAB)
);
}
......
public function quoteJSvalueEscapesLinefeed() {
$this->assertEquals(
"'" . '\n' . "'",
t3lib_div::quoteJSvalue(chr(10))
t3lib_div::quoteJSvalue(LF)
);
}
......
public function quoteJSvalueEscapesCarriageReturn() {
$this->assertEquals(
"'" . '\r' . "'",
t3lib_div::quoteJSvalue(chr(13))
t3lib_div::quoteJSvalue(CR)
);
}
tests/regularexpression_testcase.php (working copy)
*/
public function split1() {
$string = 'test1, test2|test3;test4';
$array1 = split(',|;|'.chr(10),$string);
$array2 = preg_split('/[,;'.chr(10).']/',$string);
$array1 = split(',|;|'.LF,$string);
$array2 = preg_split('/[,;'.LF.']/',$string);
foreach($array1 as $key => $value) {
$this->assertTrue(
($array2[$key] === $value)
(10-10/11)