Apache-Test for the PHP CLI

27 Jan 2005

Now there's even more reason to be using Apache-Test to test PHP applications:

From Geoff's blog:

today I added the ability to run client-side PHP scripts to Apache-Test. so, now you can have

t/foo.t
t/bar.php
t/response/TestPHP/baz.php


all within the same t/ directory.

the perl script t/foo.t will run using perl, just like always. t/bar.php will run using the php command-line interpreter, while t/response/TestPHP/baz.php will run via PHP within the Apache runtime (through standard Apache-Test magic). and all are executed with a simple make test and tabulated on the command line like you would expect.

Geoff also provides an example t/foo.php:

  1. <?php
  2.  
  3. require 'test-more.php';
  4.  
  5. plan(1);
  6.  
  7. diag('this is a php test');
  8.  
  9. is('php', 'perl', 'something php passed');
  10.  
  11. ?>

This is a really great testing framework for PHP that I hope keeps getting more and more attention.