TYPO3 CMS  TYPO3_7-6
JsonViewTest.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  */
16 
18 
23 {
28  {
29  $jsonView = $this->getAccessibleMock(\TYPO3\CMS\Install\View\JsonView::class, ['dummy']);
30  $this->assertInternalType('array', $jsonView->_call('transformStatusMessagesToArray'));
31  }
32 
38  {
39  $jsonView = $this->getAccessibleMock(\TYPO3\CMS\Install\View\JsonView::class, ['dummy']);
40  $jsonView->_call('transformStatusMessagesToArray', ['foo']);
41  }
42 
47  {
48  $status = $this->getMock(\TYPO3\CMS\Install\Status\StatusInterface::class);
49  $status->expects($this->once())->method('getSeverity')->will($this->returnValue(-2));
50  $status->expects($this->once())->method('getTitle')->will($this->returnValue('aTitle'));
51  $status->expects($this->once())->method('getMessage')->will($this->returnValue('aMessage'));
52  $jsonView = $this->getAccessibleMock(\TYPO3\CMS\Install\View\JsonView::class, ['dummy']);
53  $return = $jsonView->_call('transformStatusToArray', $status);
54  $this->assertSame(-2, $return['severity']);
55  $this->assertSame('aTitle', $return['title']);
56  $this->assertSame('aMessage', $return['message']);
57  }
58 }
getAccessibleMock( $originalClassName, $methods=[], array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true)