title: Code Coverage with PHPUnitSeleniumTestcase
body: <p>I have written Selenium Test case for PHP. I would like to get the code coverage for while I execute these test cases. My testcase:</p>
  
  <pre><code>&lt;?php
  class Example extends PHPUnit_Extensions_SeleniumTestCase
  {
    protected $coverageScriptUrl = 'http://applicationname/phpunit_coverage.php';
  
    protected function setUp()
    {
      $this-&gt;setBrowser("*firefox");
      $this-&gt;setBrowserUrl("http://applicationname");
      $this-&gt;setCollectCodeCoverageInformation(true);
      $this-&gt;setTestId("10001");
      $this-&gt;setHost("applicationname");
    }
  
    public function testMyTestCase()
    {
      $this-&gt;open("http://applicationame");
      $this-&gt;assertEquals("title", $this-&gt;getTitle());
      $this-&gt;type("id=ext-comp-1002", "testuser");
      $this-&gt;fireEvent("id=ext-comp-1002", "blur");
      $this-&gt;type("id=ext-comp-1003", "testpassword");
      $this-&gt;fireEvent("id=ext-comp-1003", "blur");
      $this-&gt;click("ext-gen45");
      $this-&gt;waitForPageToLoad("200000");
  }
  }
  ?&gt;
  </code></pre>
  
  <p>I have followed the steps mentioned in the link "http://www.phpunit.de/manual/current/en/selenium.html"</p>
  
  <p>After running the test I am not able to find the code coverage. In phpunit_coverage.php, it is looking cookie with name PHPUNIT_SELENIUM_TEST_ID. This cookie is being created in Driver.php and I see cookie is available, but it has hostname to set to "localhost" rather than my application name.</p>
  
  <p>Cookie life time is set session i.e. means immediately after test case execution this cookie will no longer available and when I try to launch phpunit_coverage.php, it is not able to find the cookie and information so no code coverage is appearing.</p>
  
  <p>Things I don't understand:</p>
  
  <ol>
  <li><code>protected $coverageScriptUrl = 'http://applicationname/phpunit_coverage.php';</code></li>
  <li>If the cookie has has different host other than application can this cookie be accessable</li>
  </ol>
  
  <p>I have seen this problem being discussed in many forums, but one gave concrete answer</p>
  
  <p>Many forums suggested to use <code>localhost</code> instead of <code>127.0.0.1</code> as server name. In my case it is already localhost.</p>
  
  <p>Any suggestion in this regard will be helpful.</p>
  
  <p>Thanks,
  Ravuri</p>