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;
}
My assertions are : 1). $rfid is a string 5 characters long 2). I am getting a valid result set
Thank You
Please assume that I have the following Unit Test code:
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() {
}
public function testGetAllVideosByRfid() {
*What should I put here****
}