/** * Tests the JWeb::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.'); }