unittest.php
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 55 行
PHP
55 行
<?php/*** UnitTest* Unit test interface for DB_NestedSet** @author Daniel Khan <dk@webcluster.at>* @package DB_NestedSetTest* @version $Revision: 1.11 $* @access public*/class DB_NestedSetTest extends TestBase { function setUp() { $params = array( "STRID" => "id", // "id" must exist "ROOTID" => "rootid", // "rootid" must exist "l" => "l", // "l" must exist "r" => "r", // "r" must exist "STREH" => "norder", // "order" must exist "LEVEL" => "level", // "level" must exist "STRNA" => "name", // Custom - specify as many fields you want "parent" => "parent" // Custom - specify as many fields you want ); $db_driver = 'DB'; $db_dsn = 'mysql://user:password@localhost/test'; $this->_NeSe = DB_NestedSet::factory($db_driver, $db_dsn, $params); $this->_NeSe->setAttr(array ( 'node_table' => 'tb_nodes', 'lock_table' => 'tb_locks', 'lockTTL' => 5, 'debug' => 0) ); $this->_NeSe2 = DB_NestedSet::factory($db_driver, $db_dsn, $params); $this->_NeSe2->setAttr(array ( 'node_table' => 'tb_nodes2', 'lock_table' => 'tb_locks', 'lockTTL' => 5, 'debug' => 0) ); } function tearDown() { $tb = $this->_NeSe->node_table; $sql = "DELETE FROM $tb"; $this->_NeSe->db->query($sql); }}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?