📄 definehsptest.php
字号:
<?php
// Call DefineHspTest::main() if this source file is executed directly.
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'DefineHspTest::main');
}
require_once "PHPUnit/Framework/TestCase.php";
require_once "PHPUnit/Framework/TestSuite.php";
require_once 'DefineHsp.php';
require_once ROOT_PATH."/lib/confs/Conf.php";
require_once ROOT_PATH."/lib/common/UniqueIDGenerator.php";
/**
* Test class for DefineHsp.
* Generated by PHPUnit on 2008-02-18 at 11:42:04.
*/
class DefineHspTest extends PHPUnit_Framework_TestCase {
/**
* 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('DefineHspTest');
$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() {
$conf = new Conf();
$this->connection = mysql_connect($conf->dbhost.":".$conf->dbport, $conf->dbuser, $conf->dbpass);
mysql_select_db($conf->dbname);
$this->assertTrue(mysql_query("INSERT INTO hs_hr_config (`key`, `value`) VALUES('hsp_current_plan', '0')"), mysql_error());
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*
* @access protected
*/
protected function tearDown() {
$this->assertTrue(mysql_query("TRUNCATE `hs_hr_config`;", $this->connection), mysql_error());
UniqueIDGenerator::getInstance()->resetIDs();
}
public function testfetchHsp() {
$DefineHsp = DefineHsp::fetchHsp();
$expected = '0';
$this->assertEquals($expected, $DefineHsp);
}
}
// Call DefineHspTest::main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == 'DefineHspTest::main') {
DefineHspTest::main();
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -