Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")
<?php
class MembersTest extends PHPUnit_TestCase {
public function testing_insertData()
{
$newinsertdata=new Members;
$newinsertdata->AddMember('1','testFname','testLname','testAddress','testCity','testState','123456','India','1234567','test@testmail.com','1234567890','true','members');
$memberid_insertd=mysql_insert_id();
$resExpectedInsertd=array((string)$memberid_insertd,'1','testFname','testLname','testAddress','testCity','testState','123456','India','1234567','test@testmail.com','1234567890','true');
$query=mysql_query("SELECT * FROM members WHERE memberId=$memberid_insertd");
$resActualInsertd=mysql_fetch_row($query);
$this->assertEquals($resExpectedInsertd,$resActualInsertd, "COULD NOT INSERT DATA.");
}
}
?>
How to access values of $resExpectedInsertd, $resActualInsertd?
To access a variable, it must be returned from the called method. If you are trying to adapt the Reporter element of PHPUnit (as you seemed aimed at in another thread) then the values have been passed into the TestCase and recorded there (i.e. it should record all data associated with a specific test, e.g. your $this->assertEquals() call).
So, you can either access it down the line in a reporter, or return an array/stdClass from the test method.