Search code examples
phphudsonphingautomated-tests

How to integrate phpRack with phing for automated testing?


For PHPUnit tag is supported in phing's build.xml. What to do if the automated tests use phpRack? i.e. extend phpRack_Test class


Solution

  • The phpRack docs say that phpRack can be integrated with phing like this:

    <target name="phpRack" description="Validate all integration tests">
        <http-request
            url="http://example.com/phprack.php?suite"
            authUser="john"
            authPassword="jf7mF4"
            responseRegex="/PHPRACK SUITE: OK/"
            verbose="true"
            observerEvents="connect, receivedBody, disconnect"
        />
    </target>
    

    By making this phing task fail when the result doesn't contain "OK" your build will also fail.

    I have no clue how you can store the resulting page with phing though.