TYPO3 CMS  TYPO3_6-2
PhpErrorCodeViewHelperTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $viewHelper;
26 
30  public function setUp() {
31  $this->viewHelper = $this->getMock('TYPO3\CMS\Install\ViewHelpers\Format\PhpErrorCodeViewHelper', array('dummy'));
32  }
33 
37  public function errorCodesDataProvider() {
38  return array(
39  array(
40  'errorCode' => E_ERROR,
41  'expectedString' => 'E_ERROR',
42  ),
43  array(
44  'errorCode' => E_ALL,
45  'expectedString' => 'E_ALL',
46  ),
47  array(
48  'errorCode' => E_ERROR ^ E_WARNING ^ E_PARSE,
49  'expectedString' => 'E_ERROR | E_WARNING | E_PARSE',
50  ),
51  array(
52  'errorCode' => E_RECOVERABLE_ERROR ^ E_USER_DEPRECATED,
53  'expectedString' => 'E_RECOVERABLE_ERROR | E_USER_DEPRECATED',
54  )
55  );
56  }
57 
64  public function renderPhpCodesCorrectly($errorCode, $expectedString) {
65  $actualString = $this->viewHelper->render($errorCode);
66  $this->assertEquals($expectedString, $actualString);
67  }
68 
69 }