Installing PHPUnit, CruiseControl, and Selenium

Install PHP Unit, and Selenium

		pear channel-discover
		pear isntall
		pear install phpunit/PHPUnit_Selenium

Download the Selenium Standalone Server and run it. The PHPUnit selenium code will make calls to the Selenium server.

		java -jar selenium-server-standalone-2.39.0.jar

Next download and unpackage it

Install PHP Under Control

		pear channel-discover
		pear channel-discover
		pear install --alldeps phpuc/phpUnderControl-beta

Download phpUnderControl Cruisecontrol Upgrade

		git clone git://
		phpuc install C:\cruisecontrol-bin-2.8.4

The CruiseControl File config.xml in the cruisecontrol-bin-2.8.4

		<project name="projectname" buildafterfailed="false">
		<schedule interval="30">
		<ant anthome="apache-ant-1.7.0" buildfile="C:\tests\build.xml"/>

The Ant file in the home directory of the project

<?xml version="1.0" encoding="UTF-8"?>
 <project name="testbuild" default="phpunit" basedir=".">
   <target name="phpunit">
      <exec executable="C:\PHP\phpunit.bat" dir="C:\tests\phpunit" failonerror="on">
	  <arg line="--log-junit C:\tests\build\logs\phpunit.xml
	     --configuration C:\tests\phpunit.xml
	     --include-path C:\PHP\pear C:\tests\includes C:\project\includes"

Modify config.xml in the Cruisecontrol directory. There are quite a few other elements inside the projects tag that you should use but to get it working all you need is schedule.

<project name="project-01" buildafterfailed="false">
    <schedule interval="30">
        <ant anthome="apache-ant-1.7.0" buildfile="C:\tests\build.xml"/>

Add phpunit.xml to the root directory of the test project

<phpunit backupGlobals="false"
    <testsuite name="Tests">
      <directory suffix=".php">C:\tests\folder\index</directory>
      <directory suffix=".php">C:\tests\folder\login</directory>
      <directory suffix=".php">C:\tests\folder\registration</directory>


Need Help?

Because I like writing code I would be happy to help you solve problems if you have questions you cannot find the answer to yourself for some reason.

Contact me