/**
	 * Tests the JApplicationWeb::appendBody method.
	 *
	 * @return  void
	 *
	 * @since   11.3
	 */
	public function testAppendBody()
	{
		// Similulate a previous call to setBody or appendBody.
		TestReflection::getValue($this->class, 'response')->body = array('foo');

		$this->class->appendBody('bar');

		$this->assertThat(
			TestReflection::getValue($this->class, 'response')->body,
			$this->equalTo(
				array('foo', 'bar')
			),
			'Checks the body array has been appended.'
		);

		$this->class->appendBody(true);

		$this->assertThat(
			TestReflection::getValue($this->class, 'response')->body,
			$this->equalTo(
				array('foo', 'bar', '1')
			),
			'Checks that non-strings are converted to strings.'
		);
	}
 /**
  * Tests the JApplicationWeb::appendBody method.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function testAppendBody()
 {
     // Similulate a previous call to setBody or appendBody.
     TestReflection::getValue($this->class, 'response')->body = array('foo');
     $this->class->appendBody('bar');
     $this->assertEquals(array('foo', 'bar'), TestReflection::getValue($this->class, 'response')->body);
     $this->class->appendBody(true);
     $this->assertEquals(array('foo', 'bar', '1'), TestReflection::getValue($this->class, 'response')->body);
 }
示例#3
0
 /**
  * Tests the JApplicationWeb::appendBody method.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function testAppendBody()
 {
     // Similulate a previous call to setBody or appendBody.
     $this->inspector->getClassProperty('response')->body = array('foo');
     $this->inspector->appendBody('bar');
     $this->assertThat($this->inspector->getClassProperty('response')->body, $this->equalTo(array('foo', 'bar')), 'Checks the body array has been appended.');
     $this->inspector->appendBody(array('goo'));
     $this->assertThat($this->inspector->getClassProperty('response')->body, $this->equalTo(array('foo', 'bar', 'Array')), 'Checks that non-strings are converted to strings.');
 }