Re: PHP-GTK 2 Unit Testing
| From: | Scott Mattocks | Date: | Tue, 28 Feb 2006 19:39:52 +0000 |
| Subject: | Re: PHP-GTK 2 Unit Testing | ||
| References: | 1 2 3 4 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2461@lists.php.net to get a copy of this message | ||
Anant Narayanan wrote:
That's a good point. Maybe you could just mail the list the script that you wrote, and interested people can have a look at it, and that way we can move it forward.For the PHPUnit2_Util_Skeleton patch see the bug report: http://pear.php.net/bugs/bug.php?id=6965 Here is the script I used (part of it should look familiar): <?php // Use PHPUnit2 to create the skeletons. require_once 'PHPUnit2/Util/Skeleton.php'; // Get all of the classes in PHP-GTK 2. /* Get all classes and filter out Gtk classes only */ // Taken from Anant's updater script. $classes = array(); $allClasses = get_declared_classes(); $extensions = array('Gtk', 'Gdk', 'Atk', 'Pango'); foreach ($extensions as $extension) {
foreach($allClasses as $oneClass) {
if(strpos($oneClass, $extension) === 0) {
$classes[] = $oneClass;
}
}
}
sort($classes);
foreach ($classes as $class) {
// Create a skeleton for the class.
$skeleton = new PHPUnit2_Util_Skeleton($class);
// Write the test.
$skeleton->write();
}
?>
--
Scott Mattocks
http://www.crisscott.com