TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
DebuggerUtilityTest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Extbase\Tests\Unit\Utility;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
18 
23 {
27  public function debuggerRewindsInstancesOfIterator()
28  {
30  $objectStorage = $this->getMockBuilder(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class)
31  ->setMethods(['dummy'])
32  ->getMock();
33  for ($i = 0; $i < 5; $i++) {
34  $obj = new \stdClass();
35  $obj->property = $i;
36  $objectStorage->attach($obj);
37  }
38  DebuggerUtility::var_dump($objectStorage, null, 8, true, false, true);
39  $this->assertTrue($objectStorage->valid());
40  }
41 
46  {
47  $testObject = new \stdClass();
48  $testObject->foo = 'bar';
49  $result = DebuggerUtility::var_dump($testObject, null, 8, true, false, true);
50  $this->assertRegExp('/foo.*bar/', $result);
51  }
52 
58  {
59  $testClass = new \stdClass();
60  $testClass->secretData = 'I like cucumber.';
61  $testClass->notSoSecretData = 'I like burger.';
62 
63  $result = DebuggerUtility::var_dump($testClass, null, 8, true, false, true, null, ['secretData']);
64  self::assertNotContains($testClass->secretData, $result);
65  }
66 
72  {
73  $testClass = new \stdClass();
74  $testClass->data = 'I like burger.';
75 
76  $result = DebuggerUtility::var_dump($testClass, null, 8, true, false, true, [\stdClass::class]);
77  self::assertNotContains($testClass->data, $result);
78  }
79 }
static var_dump($variable, $title=null, $maxDepth=8, $plainText=false, $ansiColors=true, $return=false, $blacklistedClassNames=null, $blacklistedPropertyNames=null)