/** * Tests the JApplicationWeb::prependBody method. * * @return void * * @since 11.3 */ public function testPrependBody() { // Similulate a previous call to a body method. TestReflection::getValue($this->class, 'response')->body = array('foo'); $this->class->prependBody('bar'); $this->assertThat( TestReflection::getValue($this->class, 'response')->body, $this->equalTo( array('bar', 'foo') ), 'Checks the body array has been prepended.' ); $this->class->prependBody(true); $this->assertThat( TestReflection::getValue($this->class, 'response')->body, $this->equalTo( array('1', 'bar', 'foo') ), 'Checks that non-strings are converted to strings.' ); }
/** * Tests the JApplicationWeb::prependBody method. * * @return void * * @since 11.3 */ public function testPrependBody() { // Similulate a previous call to a body method. TestReflection::getValue($this->class, 'response')->body = array('foo'); $this->class->prependBody('bar'); $this->assertEquals(array('bar', 'foo'), TestReflection::getValue($this->class, 'response')->body); $this->class->prependBody(true); $this->assertEquals(array('1', 'bar', 'foo'), TestReflection::getValue($this->class, 'response')->body); }
/** * Tests the JApplicationWeb::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.'); }