The constructor creates the connection and selects the db using the built in PHP functions. I also have the following two functions:
Code: Select all
public function fetch($sql)
{
$this->query = mysql_query($sql,$this->db);
}
public function getRow()
{
if ($row = mysql_fetch_array($this->query, MYSQL_ASSOC))
return $row;
else
return false;
}Ultimately, I want to mock the results returned from the database to test that the data is handled properly.
Are partial mocks the answer? But how do I partially mock the class I am testing?
I'm using SimpleTest BTW.
Thanks in advance!