[FOLLOWUP][TASK] Refactor debugger console 61/38461/5
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 3 Apr 2015 15:00:26 +0000 (17:00 +0200)
committerAndreas Fernandez <andreas.fernandez@aspedia.de>
Fri, 3 Apr 2015 15:52:04 +0000 (17:52 +0200)
* Fix unit tests
* Fix usage of DebuggerUtility::var_dump()

Resolves: #65956
Releases: master
Change-Id: I7350869c9654b462214a18e33397e14517c87b88
Reviewed-on: http://review.typo3.org/38461
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
typo3/sysext/backend/Resources/Public/JavaScript/DebugConsole.js
typo3/sysext/core/Classes/Utility/DebugUtility.php
typo3/sysext/core/Resources/Private/Language/debugger.xlf
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php

index e0b0e6c..898de64 100644 (file)
@@ -127,7 +127,7 @@ define('TYPO3/CMS/Backend/DebugConsole', ['jquery'], function ($) {
                        $line.prepend($('<strong />').text(header));
                }
 
-               if (typeof group === 'undefined') {
+               if (typeof group === 'undefined' || group.length === 0) {
                        group = 'Debug';
                }
 
index 49ea998..83ca3fb 100644 (file)
@@ -159,7 +159,7 @@ class DebugUtility {
                if ($returnHTML !== FALSE) {
                        GeneralUtility::deprecationLog('Setting the parameter $returnHTML is deprecated since TYPO3 CMS 7 and will be removed in TYPO3 CMS 8.');
                }
-               self::debug(DebuggerUtility::var_dump($rows, $header, 8, FALSE, TRUE, TRUE), $header);
+               self::debug('<pre>' . DebuggerUtility::var_dump($rows, $header, 8, TRUE, FALSE, TRUE), $header . '</pre>');
        }
 
        /**
@@ -189,7 +189,7 @@ class DebugUtility {
         * @return string HTML output
         */
        static public function viewArray($array_in) {
-               return DebuggerUtility::var_dump($array_in, '', 8, FALSE, TRUE, TRUE);
+               return '<pre>' . DebuggerUtility::var_dump($array_in, '', 8, TRUE, FALSE, TRUE) . '</pre>';
        }
 
        /**
index adbaa4e..08cd401 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
-       <file t3:id="1417684108" source-language="en" datatype="plaintext" original="messages" date="2014-12-04T09:12:34Z" product-name="core">
+       <file t3:id="1428074821" source-language="en" datatype="plaintext" original="messages" date="2015-04-04T17:30:25Z" product-name="core">
                <header/>
                <body>
                        <trans-unit id="debuggerconsole.autoscroll" xml:space="preserve">
index cf9214b..0b3f09e 100644 (file)
@@ -2053,7 +2053,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        1 => array('uid' => 2, 'title' => 'title2'),
                        2 => array('uid' => 3, 'title' => ''),
                );
-               $expectedResult = '0uid1titletitle11uid2titletitle22uid3title';
+               $expectedResult = 'array(3items)0=>array(2items)uid=>1(integer)title=>"title1"(6chars)1=>array(2items)uid=>2(integer)title=>"title2"(6chars)2=>array(2items)uid=>3(integer)title=>""(0chars)';
                $GLOBALS['TSFE']->tmpl->rootLine = $rootline;
 
                $result = $this->subject->getData('debug:rootLine');
@@ -2077,7 +2077,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        1 => array('uid' => 2, 'title' => 'title2'),
                        2 => array('uid' => 3, 'title' => ''),
                );
-               $expectedResult = '0uid1titletitle11uid2titletitle22uid3title';
+               $expectedResult = 'array(3items)0=>array(2items)uid=>1(integer)title=>"title1"(6chars)1=>array(2items)uid=>2(integer)title=>"title2"(6chars)2=>array(2items)uid=>3(integer)title=>""(0chars)';
                $GLOBALS['TSFE']->rootLine = $rootline;
 
                $result = $this->subject->getData('debug:fullRootLine');
@@ -2100,7 +2100,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $value = $this->getUniqueId('someValue');
                $this->subject->data = array($key => $value);
 
-               $expectedResult = $key . $value;
+               $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
 
                $result = $this->subject->getData('debug:data');
                $cleanedResult = strip_tags($result);
@@ -2122,7 +2122,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $value = $this->getUniqueId('someValue');
                $GLOBALS['TSFE']->register = array($key => $value);
 
-               $expectedResult = $key . $value;
+               $expectedResult = 'array(1item)' . $key . '=>"' . $value . '"(' . strlen($value) . 'chars)';
 
                $result = $this->subject->getData('debug:register');
                $cleanedResult = strip_tags($result);
@@ -2143,7 +2143,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $uid = rand();
                $GLOBALS['TSFE']->page = array('uid' => $uid);
 
-               $expectedResult = 'uid' . $uid;
+               $expectedResult = 'array(1item)uid=>' . $uid . '(integer)';
 
                $result = $this->subject->getData('debug:page');
                $cleanedResult = strip_tags($result);