TYPO3 CMS  TYPO3_7-6
DebuggerUtilityTest.php
Go to the documentation of this file.
1 <?php
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->getMock(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class, ['dummy']);
31  for ($i = 0; $i < 5; $i++) {
32  $obj = new \StdClass();
33  $obj->property = $i;
34  $objectStorage->attach($obj);
35  }
36  DebuggerUtility::var_dump($objectStorage, null, 8, true, false, true);
37  $this->assertTrue($objectStorage->valid());
38  }
39 
43  public function debuggerDoesNotRewindInstanceOfArrayAccess()
44  {
45  $parameters = [];
46  for ($i = 0; $i < 5; $i++) {
47  $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('argument_' . $i, 'integer');
48  $parameters[$i] = $argument;
49  }
50 
52  $arguments = $this->getMock(\TYPO3\CMS\Fluid\Core\ViewHelper\Arguments::class, ['dummy'], ['arguments' => $parameters]);
53 
54  $arguments->expects($this->never())->method('rewind');
55  DebuggerUtility::var_dump($arguments, null, 8, true, false, true);
56  }
57 
62  {
63  $testObject = new \stdClass();
64  $testObject->foo = 'bar';
65  $result = DebuggerUtility::var_dump($testObject, null, 8, true, false, true);
66  $this->assertRegExp('/foo.*bar/', $result);
67  }
68 
74  {
75  $testClass = new \stdClass();
76  $testClass->secretData = 'I like cucumber.';
77  $testClass->notSoSecretData = 'I like burger.';
78 
79  $result = DebuggerUtility::var_dump($testClass, null, 8, true, false, true, null, ['secretData']);
80  self::assertNotContains($testClass->secretData, $result);
81  }
82 
88  {
89  $testClass = new \stdClass();
90  $testClass->data = 'I like burger.';
91 
92  $result = DebuggerUtility::var_dump($testClass, null, 8, true, false, true, [\stdClass::class]);
93  self::assertNotContains($testClass->data, $result);
94  }
95 }
static var_dump($variable, $title=null, $maxDepth=8, $plainText=false, $ansiColors=true, $return=false, $blacklistedClassNames=null, $blacklistedPropertyNames=null)