| <?php |
| // Call {className}Test::main() if this source file is executed directly. |
| if (!defined('PHPUnit_MAIN_METHOD')) { |
| define('PHPUnit_MAIN_METHOD', '{className}Test::main'); |
| } |
| |
| require_once 'PHPUnit/Framework.php';{requireClassFile} |
| |
| /** |
| * Test class for {className}. |
| * Generated by PHPUnit on {date} at {time}. |
| */ |
| class {className}Test extends PHPUnit_Framework_TestCase |
| { |
| /** |
| * @var {className} |
| * @access protected |
| */ |
| protected $object; |
| |
| /** |
| * Runs the test methods of this class. |
| * |
| * @access public |
| * @static |
| */ |
| public static function main() |
| { |
| require_once 'PHPUnit/TextUI/TestRunner.php'; |
| |
| $suite = new PHPUnit_Framework_TestSuite('{className}Test'); |
| $result = PHPUnit_TextUI_TestRunner::run($suite); |
| } |
| |
| /** |
| * Sets up the fixture, for example, opens a network connection. |
| * This method is called before a test is executed. |
| * |
| * @access protected |
| */ |
| protected function setUp() |
| { |
| $this->object = new {className}; |
| } |
| |
| /** |
| * Tears down the fixture, for example, closes a network connection. |
| * This method is called after a test is executed. |
| * |
| * @access protected |
| */ |
| protected function tearDown() |
| { |
| } |
| {methods}} |
| |
| // Call {className}Test::main() if this source file is executed directly. |
| if (PHPUnit_MAIN_METHOD == '{className}Test::main') { |
| {className}Test::main(); |
| } |
| ?> |