TYPO3 CMS  TYPO3_6-2
DebuggerUtilityTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $debugger;
26 
27  public function setUp() {
28  $this->debugger = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility', array('dummy'));
29  }
30 
35  public function debuggerRewindsInstancesOfIterator() {
37  $objectStorage = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('dummy'));
38  for ($i = 0; $i < 5; $i++) {
39  $obj = new \StdClass();
40  $obj->property = $i;
41  $objectStorage->attach($obj);
42  }
43  $this->debugger->var_dump($objectStorage, NULL, 8, TRUE, FALSE, TRUE);
44  $this->assertTrue($objectStorage->valid());
45  }
46 
51  public function debuggerDoesNotRewindInstanceOfArrayAccess() {
52 
53  $parameters = array();
54  for ($i = 0; $i < 5; $i++) {
55  $argument = new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('argument_' . $i, 'integer');
56  $parameters[$i] = $argument;
57  }
58 
60  $arguments = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\Arguments', array('dummy'), array('arguments' => $parameters));
61 
62  $arguments->expects($this->never())->method('rewind');
63  $this->debugger->var_dump($arguments, NULL, 8, TRUE, FALSE, TRUE);
64  }
65 
70  $testObject = new \stdClass();
71  $testObject->foo = 'bar';
72  $result = $this->debugger->var_dump($testObject, NULL, 8, TRUE, FALSE, TRUE);
73  $this->assertRegExp('/foo.*bar/', $result);
74  }
75 }
$parameters
Definition: FileDumpEID.php:15
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren&#39;t numeric.