Rev | Line | |
---|
[1] | 1 | <?php |
---|
| 2 | require_once 'PHPUnit/Skeleton.php'; |
---|
| 3 | |
---|
| 4 | $dir = dirname(__FILE__) . '/../lib'; |
---|
| 5 | |
---|
| 6 | $dir_handle = opendir($dir); |
---|
| 7 | while ($dir_handle && ($file = readdir($dir_handle)) !== false) { |
---|
| 8 | if (!preg_match('/^\./', $file) && is_file($dir . '/' . $file)) { |
---|
| 9 | echo 'Proccessing ' . realpath($dir . '/' . $file) . "\n"; |
---|
| 10 | |
---|
| 11 | preg_match('/([^\.]+)\..*$/i', $file, $match); |
---|
| 12 | $classname = $match[1]; |
---|
| 13 | |
---|
| 14 | $ps = new PHPUnit_Skeleton($classname, '../lib/' . $file); |
---|
| 15 | |
---|
| 16 | // Generate the test class. |
---|
| 17 | // Default settings will not include any parent class methods, but |
---|
| 18 | // will include private methods. |
---|
| 19 | $ps->createTestClass(); |
---|
| 20 | |
---|
| 21 | // Write the new test class to file. |
---|
| 22 | // By default, code to run the test will be included. |
---|
| 23 | $ps->writeTestClass(); |
---|
| 24 | |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.