‪TYPO3CMS  10.4
ResponseTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪ResponseTest extends UnitTestCase
25 {
29  protected ‪$response;
30 
31  protected function ‪setUp(): void
32  {
33  parent::setUp();
34  $this->response = new ‪Response();
35  }
36 
40  public function ‪propertyContentInitiallyIsNull(): void
41  {
42  self::assertNull($this->response->getContent());
43  }
44 
48  public function ‪setContentSetsContentCorrectly(): void
49  {
50  $this->response->setContent('foo');
51  self::assertSame('foo', $this->response->getContent());
52  }
53 
57  public function ‪appendContentAppendsContentCorrectly(): void
58  {
59  $this->response->setContent('foo');
60  $this->response->appendContent('bar');
61  self::assertSame('foobar', $this->response->getContent());
62  }
63 
67  public function ‪getContentReturnsContentCorrectly(): void
68  {
69  $this->response->setContent('foo');
70  self::assertSame('foo', $this->response->getContent());
71  }
72 
76  public function ‪__toStringReturnsActualContent(): void
77  {
78  $this->response->setContent('foo');
79  self::assertSame('foo', (string)$this->response);
80  }
81 }
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\setUp
‪setUp()
Definition: ResponseTest.php:30
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\__toStringReturnsActualContent
‪__toStringReturnsActualContent()
Definition: ResponseTest.php:75
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\$response
‪TYPO3 CMS Extbase Mvc Response PHPUnit Framework MockObject MockObject TYPO3 TestingFramework Core AccessibleObjectInterface $response
Definition: ResponseTest.php:28
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest
Definition: ResponseTest.php:25
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\propertyContentInitiallyIsNull
‪propertyContentInitiallyIsNull()
Definition: ResponseTest.php:39
‪TYPO3\CMS\Extbase\Mvc\Response
Definition: Response.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\setContentSetsContentCorrectly
‪setContentSetsContentCorrectly()
Definition: ResponseTest.php:47
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\appendContentAppendsContentCorrectly
‪appendContentAppendsContentCorrectly()
Definition: ResponseTest.php:56
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\ResponseTest\getContentReturnsContentCorrectly
‪getContentReturnsContentCorrectly()
Definition: ResponseTest.php:66
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc