Dealing with HTTP Status Codes in PHPUnit_Extensions_Selenium2TestCase

Posted by frosty on Stack Overflow See other posts from Stack Overflow or by frosty
Published on 2012-12-06T17:02:08Z Indexed on 2012/12/06 17:03 UTC
Read the original article Hit count: 404

Filed under:
|
|

I have a series of tests that I'm running for an Open Source Project, I'd like to get the status code of the curl request that is made to determine the difference of a code change breaking functionality vs a code change breaking the site completely.

    class ExampleTest extends PHPUnit_Extensions_Selenium2TestCase
    {
        public function setUp()
        {
            $this->setBrowser('firefox');
            $this->setBrowserUrl('http://localhost');
        }

        public function testForError()
        {
            $this->url('/');
            $this->assertNotEmpty($this->title());
        }
    }

That's an example of how I'm going about it now, but I'd like to have some concrete information. Short of getting the information from the CURL request, I'm not really sure how to go about this...

© Stack Overflow or respective owner

Related posts about php

Related posts about selenium