cvs: pear /PHPUnit2 package.xml /PHPUnit2/Util Skeleton.php
| From: | Sebastian Bergmann | Date: | Tue, 05 Apr 2005 09:05:26 +0000 |
| Subject: | cvs: pear /PHPUnit2 package.xml /PHPUnit2/Util Skeleton.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30930@lists.php.net to get a copy of this message | ||
sebastian Tue Apr 5 05:05:26 2005 EDT
Modified files:
/pear/PHPUnit2/Util Skeleton.php
/pear/PHPUnit2 package.xml
Log:
Generate stubs for the setUp() and tearDown() methods. More code comments in generated code.
http://cvs.php.net/diff.php/pear/PHPUnit2/Util/Skeleton.php?r1=1.18&r2=1.19&ty=u
Index: pear/PHPUnit2/Util/Skeleton.php
diff -u pear/PHPUnit2/Util/Skeleton.php:1.18 pear/PHPUnit2/Util/Skeleton.php:1.19
--- pear/PHPUnit2/Util/Skeleton.php:1.18 Wed Feb 9 01:23:12 2005
+++ pear/PHPUnit2/Util/Skeleton.php Tue Apr 5 05:05:25 2005
@@ -12,7 +12,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: Skeleton.php,v 1.18 2005/02/09 06:23:12 sebastian Exp $
+// $Id: Skeleton.php,v 1.19 2005/04/05 09:05:25 sebastian Exp $
//
/**
@@ -49,15 +49,18 @@
protected $templateClassHeader =
'<?php
+// Call {className}Test::main() if this source file is executed directly.
if (!defined("PHPUnit2_MAIN_METHOD")) {
define("PHPUnit2_MAIN_METHOD", "{className}Test::main");
}
-require_once "PHPUnit2/Framework/IncompleteTestError.php";
require_once "PHPUnit2/Framework/TestCase.php";
require_once "PHPUnit2/Framework/TestSuite.php";
require_once "PHPUnit2/TextUI/TestRunner.php";
+// You may remove the following line when all tests have been implemented.
+require_once "PHPUnit2/Framework/IncompleteTestError.php";
+
require_once "{classFile}";
/**
@@ -65,15 +68,40 @@
* Generated by PHPUnit2_Util_Skeleton on {date} at {time}.
*/
class {className}Test extends PHPUnit2_Framework_TestCase {
+ /**
+ * Runs the test methods of this class.
+ *
+ * @access public
+ * @static
+ */
public static function main() {
$suite = new PHPUnit2_Framework_TestSuite("{className}Test");
$result = PHPUnit2_TextUI_TestRunner::run($suite);
}
+
+ /**
+ * Sets up the fixture, for example, open a network connection.
+ * This method is called before a test is executed.
+ *
+ * @access protected
+ */
+ protected function setUp() {
+ }
+
+ /**
+ * Tears down the fixture, for example, close a network connection.
+ * This method is called after a test is executed.
+ *
+ * @access protected
+ */
+ protected function tearDown() {
+ }
';
protected $templateClassFooter =
'}
+// Call {className}Test::main() if this source file is executed directly.
if (PHPUnit2_MAIN_METHOD == "{className}Test::main") {
{className}Test::main();
}
@@ -86,6 +114,7 @@
* @todo Implement test{methodName}().
*/
public function test{methodName}() {
+ // Remove the following line when you implement this test.
throw new PHPUnit2_Framework_IncompleteTestError;
}
';
http://cvs.php.net/diff.php/pear/PHPUnit2/package.xml?r1=1.88&r2=1.89&ty=u
Index: pear/PHPUnit2/package.xml
diff -u pear/PHPUnit2/package.xml:1.88 pear/PHPUnit2/package.xml:1.89
--- pear/PHPUnit2/package.xml:1.88 Thu Mar 31 02:05:35 2005
+++ pear/PHPUnit2/package.xml Tue Apr 5 05:05:26 2005
@@ -22,6 +22,8 @@
* Changed PHPUnit2_Framework_Assert::assertType() and PHPUnit2_Framework_AssertNotType() to
consider subclasses when used on objects.
+* PHPUnit2_Util_Skeleton now generates stubs for the setUp() and tearDown() methods.
+
* Moved tests outside of installation directory.
! PHP 5.1.0 (or greater) is now required.