/** * Tests the JApplicationWeb::Execute method with a document. * * @return void * * @since 11.3 */ public function testExecuteWithDocument() { $dispatcher = $this->getMockDispatcher(); $document = $this->getMockDocument(); $this->assignMockReturns($document, array('render' => 'JWeb Body')); // Manually inject the mocks. $this->class->setDispatcher($dispatcher); $this->class->loadDocument($document); // Buffer the execution. ob_start(); $this->class->execute(); $buffer = ob_get_clean(); $this->assertEquals('JWeb Body', $this->class->getBody()); $this->assertEquals('JWeb Body', $buffer); }