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(){
******ここに何を入れればいいですか*****
}