/**
  * Tests the JApplicationWeb::redirect method with headers already sent.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function testRedirectWithHeadersSent()
 {
     $base = 'http://mydomain.com/';
     $url = 'index.php';
     // Emulate headers already sent.
     JApplicationWebInspector::$headersSent = true;
     // Inject the internal configuration.
     $config = new Registry();
     $config->set('uri.base.full', $base);
     TestReflection::setValue($this->class, 'config', $config);
     // Capture the output for this test.
     ob_start();
     $this->class->redirect('index.php');
     $buffer = ob_get_clean();
     $this->assertEquals("<script>document.location.href='{$base}{$url}';</script>\n", $buffer);
 }
 /**
  * Tests the JApplicationWeb::redirect method with headers already sent.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function testRedirectWithHeadersSent()
 {
     $base = 'http://j.org/';
     $url = 'index.php';
     // Emulate headers already sent.
     JApplicationWebInspector::$headersSent = true;
     // Inject the internal configuration.
     $config = new JRegistry();
     $config->set('uri.base.full', $base);
     $this->inspector->setClassProperty('config', $config);
     // Capture the output for this test.
     ob_start();
     $this->inspector->redirect('index.php');
     $buffer = ob_get_contents();
     ob_end_clean();
     $this->assertThat($buffer, $this->equalTo("<script>document.location.href='{$base}{$url}';</script>\n"));
 }