/** * Tests the JWeb::prependBody method. * * @return void * * @since 11.3 */ public function testPrependBody() { // Similulate a previous call to a body method. $this->inspector->getClassProperty('response')->body = array('foo'); $this->inspector->prependBody('bar'); $this->assertThat($this->inspector->getClassProperty('response')->body, $this->equalTo(array('bar', 'foo')), 'Checks the body array has been prepended.'); $this->inspector->prependBody(array('goo')); $this->assertThat($this->inspector->getClassProperty('response')->body, $this->equalTo(array('Array', 'bar', 'foo')), 'Checks that non-strings are converted to strings.'); }