limit.php
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PHP 代码 · 共 69 行
PHP
69 行
<?php//// $Id: Limit.php,v 1.1 2003/06/06 14:39:44 cain Exp $//class tests_Limit extends tests_UnitTest{ // test if setLimit works function test_setLimit() { $user = new tests_Common(TABLE_USER); $user->setLimit(0,10); $this->assertEquals(array(0,10),$user->getLimit()); } // test if setLimit works function test_setLimit1() { $user = new tests_Common(TABLE_USER); $user->add(array('login'=>1)); $user->add(array('login'=>2)); $user->add(array('login'=>3)); $user->add(array('login'=>4)); $user->setLimit(0,2); $this->assertEquals(2,sizeof($user->getAll())); $user->setLimit(0,3); $this->assertEquals(3,sizeof($user->getAll())); } // test if getAll works // setLimit should have no effect when parameters are given to getAll() function test_getAll() { $user = new tests_Common(TABLE_USER); $user->setLimit(0,10); $user->add(array('login'=>1)); $user->add(array('login'=>2)); $user->add(array('login'=>3)); $user->add(array('login'=>4)); $this->assertEquals(1,sizeof($user->getAll(0,1))); $user->setLimit(0,3); $this->assertEquals(2,sizeof($user->getAll(0,2))); $this->assertEquals(3,sizeof($user->getAll())); } // test if getAll works // setLimit should have no effect when parameters are given to getAll() function test_getCol() { $user = new tests_Common(TABLE_USER); $user->setLimit(0,10); $user->add(array('login'=>1)); $user->add(array('login'=>2)); $user->add(array('login'=>3)); $user->add(array('login'=>4)); $this->assertEquals(1,sizeof($user->getCol('id',0,1))); $user->setLimit(0,3); $this->assertEquals(2,sizeof($user->getCol('id',0,2))); $this->assertEquals(3,sizeof($user->getCol('id'))); }}?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?