TYPO3 CMS  TYPO3_6-2
StatusUtilityTest.php
Go to the documentation of this file.
1 <?php
3 
17 use \TYPO3\CMS\Install\Status\StatusUtility;
18 
23 
28  $errorMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\ErrorStatus', array('dummy'));
29  $warningMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\WarningStatus', array('dummy'));
30  $okMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\OkStatus', array('dummy'));
31  $infoMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\InfoStatus', array('dummy'));
32  $noticeMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\NoticeStatus', array('dummy'));
33  $statusUtility = new StatusUtility();
34  $return = $statusUtility->sortBySeverity(array($noticeMock, $infoMock, $okMock, $warningMock, $errorMock));
35  $this->assertSame(array($errorMock), $return['error']);
36  $this->assertSame(array($warningMock), $return['warning']);
37  $this->assertSame(array($okMock), $return['ok']);
38  $this->assertSame(array($infoMock), $return['information']);
39  $this->assertSame(array($noticeMock), $return['notice']);
40  }
41 
47  $statusUtility = new StatusUtility();
48  $statusUtility->filterBySeverity(array(new \stdClass()));
49  }
50 
55  $errorMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\ErrorStatus', array('dummy'));
56  $warningMock = $this->getMock('TYPO3\\CMS\\Install\\Status\\WarningStatus', array('dummy'));
57  $statusUtility = new StatusUtility();
58  $return = $statusUtility->filterBySeverity(array($errorMock, $warningMock), 'error');
59  $this->assertSame(array($errorMock), $return);
60  }
61 }