TYPO3 CMS  TYPO3_6-2
ResponseTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $mockResponse;
26 
27  public function setUp() {
28  $this->mockResponse = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Mvc\\Response', array('dummy'));
29  }
30 
34  public function propertyContentInitiallyIsNull() {
35  $this->assertNull($this->mockResponse->_get('content'));
36  }
37 
41  public function setContentSetsContentCorrectly() {
42  $this->mockResponse->setContent('foo');
43  $this->assertSame('foo', $this->mockResponse->_get('content'));
44  }
45 
50  $this->mockResponse->_set('content', 'foo');
51  $this->mockResponse->appendContent('bar');
52  $this->assertSame('foobar', $this->mockResponse->_get('content'));
53  }
54 
59  $this->mockResponse->_set('content', 'foo');
60  $this->assertSame('foo', $this->mockResponse->getContent());
61  }
62 
66  public function __toStringReturnsActualContent() {
67  $this->mockResponse->_set('content', 'foo');
68  $this->assertSame('foo', (string) $this->mockResponse);
69  }
70 }
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)