public function getAvailableVideosByRfid($rfid, $count=200) {
$query="SELECT id FROM sometable WHERE rfid='$rfid'";
$result = mysql_query($query);
$count2 = mysql_num_rows($result);
if ($count2){ //this rfid has been claimed
return 0;
}
我的断言是:1)。$rfid 是一个 5 个字符长的字符串 2)。我得到一个有效的结果集
谢谢你
请假设我有以下单元测试代码:
class videoSharingTest extends PHPUnit_Framework_TestCase {
/**
* @var videoSharing
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp() {
$this->object = new videoSharing;
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown() {
}
公共函数 testGetAllVideosByRfid() {
*****我应该在这里放什么*****
}