#!/usr/local/bin/php * @since 01 Dec 2005 13:56:09 */ require_once 'PHPUnit/Skeleton.php'; $dir = dirname(__FILE__) . '/../lib'; if ($_SERVER['argc'] == 2 && file_exists($dir . '/' . $_SERVER['argv'][1])) { $file = $_SERVER['argv'][1]; echo 'Proccessing ' . realpath($dir . '/' . $file) . "\n"; } else { die('First argument or file not found: ' . $_SERVER['argv'][1] . "\n"); } preg_match('/([^\.]+)\..*$/i', $file, $match); $classname = $match[1]; $ps = new PHPUnit_Skeleton($classname, '../lib/' . $file); // Generate the test class. // Default settings will not include any parent class methods, but // will include private methods. $ps->createTestClass(); // Write the new test class to file. // By default, code to run the test will be included. $ps->writeTestClass(); // $dir_handle = opendir($dir); // while ($dir_handle && ($file = readdir($dir_handle)) !== false) { // if (!preg_match('/^\./', $file) && is_file($dir . '/' . $file)) { // echo 'Proccessing ' . realpath($dir . '/' . $file) . "\n"; // // preg_match('/([^\.]+)\..*$/i', $file, $match); // $classname = $match[1]; // // $ps = new PHPUnit_Skeleton($classname, '../lib/' . $file); // // // Generate the test class. // // Default settings will not include any parent class methods, but // // will include private methods. // $ps->createTestClass(); // // // Write the new test class to file. // // By default, code to run the test will be included. // $ps->writeTestClass(); // // } // } ?>