/**
* V2007/AllTests.php
*/
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'V2007_AllTests::main');
}
//List your modules HERE
require_once 'V2007/Example.php'; // For APIs
require_once 'V2007/Example/AllTests.php';
class V2007_AllTests
{
public static function main()
{
PHPUnit_TextUI_TestRunner::run(self::suite());
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('V2007 System - Rollenc.com');
$suite->addTestSuite('V2007_ExampleTest');
$suite->addTest(V2007_Example_AllTests::suite());
return $suite;
}
public static function suite()
{
$suite = new PHPUnit_Framework_TestSuite('V2007 System - rollenc.com');
//Add your Module tests HERE
$suite->addTest(V2007_Example_AllTests::suite());
return $suite;
}
}
if (PHPUnit_MAIN_METHOD == 'V2007_AllTests::main') {
V2007_AllTests::main();
}
/**
* V2007/Example/AllTest.php
*/
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'V2007_Example_AllTests::main');
}
//List your Function HERE
require_once 'V2007/Example/ArrayTest.php';
require_once 'V2007/Example/StringTest.php';
require_once 'V2007/Example/FunctionTest.php';
class V2007_Example_AllTests {
public static function main() {
PHPUnit_TextUI_TestRunner :: run(self :: suite());
}
public static function suite() {
$suite = new PHPUnit_Framework_TestSuite('V2007 System - V2007_Example');
$suite->addTestSuite('V2007_Example_ArrayTest');
$suite->addTestSuite('V2007_Example_StringTest');
$suite->addTestSuite('V2007_Example_FunctionTest');
return $suite;
}
}
if (PHPUnit_MAIN_METHOD == 'V2007_Example_AllTests::main') {
V2007_Example_AllTests::main();
}
/**
* V2007/Example/ArrayTest.php
*/
class V2007_Example_ArrayTest extends PHPUnit_Framework_TestCase
{
public function setUp() {
$this->a = array(1,2,3,4,5,6,7,8,9);
}
public function testA() {
array_push($this->a, 0);
$this->assertEquals(count($this->a), 10);
$this->assertEquals(1, 1);
}
public function testB() {
$this->assertEquals(count($this->a), 9);
}
public function tearDown() {
$this->a = array();
}
}
文章来源于领测软件测试网 https://www.ltesting.net/