/** * Tests the JWeb::getBody method. * * @return void * * @since 11.3 */ public function testGetBody() { // Fill the header body with an arbitrary value. $this->inspector->setClassProperty('response', (object) array('cachable' => null, 'headers' => null, 'body' => array('foo', 'bar'))); $this->assertThat($this->inspector->getBody(), $this->equalTo('foobar'), 'Checks the default state returns the body as a string.'); $this->assertThat($this->inspector->getBody(), $this->equalTo($this->inspector->getBody(false)), 'Checks the default state is $asArray = false.'); $this->assertThat($this->inspector->getBody(true), $this->equalTo(array('foo', 'bar')), 'Checks that the body is returned as an array.'); }