‪TYPO3CMS  9.5
ResponseTest.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 
17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
18 
22 class ‪ResponseTest extends UnitTestCase
23 {
27  protected ‪$mockResponse;
28 
29  protected function ‪setUp()
30  {
31  $this->mockResponse = $this->getAccessibleMock(\‪TYPO3\CMS\‪Extbase\Mvc\Response::class, ['dummy']);
32  }
33 
37  public function ‪propertyContentInitiallyIsNull()
38  {
39  $this->assertNull($this->mockResponse->_get('content'));
40  }
41 
45  public function ‪setContentSetsContentCorrectly()
46  {
47  $this->mockResponse->setContent('foo');
48  $this->assertSame('foo', $this->mockResponse->_get('content'));
49  }
50 
55  {
56  $this->mockResponse->_set('content', 'foo');
57  $this->mockResponse->appendContent('bar');
58  $this->assertSame('foobar', $this->mockResponse->_get('content'));
59  }
60 
64  public function ‪getContentReturnsContentCorrectly()
65  {
66  $this->mockResponse->_set('content', 'foo');
67  $this->assertSame('foo', $this->mockResponse->getContent());
68  }
69 
73  public function ‪__toStringReturnsActualContent()
74  {
75  $this->mockResponse->_set('content', 'foo');
76  $this->assertSame('foo', (string)$this->mockResponse);
77  }
78 }
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\setUp
‪setUp()
Definition: ResponseTest.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\__toStringReturnsActualContent
‪__toStringReturnsActualContent()
Definition: ResponseTest.php:72
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest
Definition: ResponseTest.php:23
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\propertyContentInitiallyIsNull
‪propertyContentInitiallyIsNull()
Definition: ResponseTest.php:36
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\setContentSetsContentCorrectly
‪setContentSetsContentCorrectly()
Definition: ResponseTest.php:44
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\appendContentAppendsContentCorrectly
‪appendContentAppendsContentCorrectly()
Definition: ResponseTest.php:53
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\getContentReturnsContentCorrectly
‪getContentReturnsContentCorrectly()
Definition: ResponseTest.php:63
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\$mockResponse
‪TYPO3 CMS Extbase Mvc Response PHPUnit_Framework_MockObject_MockObject TYPO3 TestingFramework Core AccessibleObjectInterface $mockResponse
Definition: ResponseTest.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc