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")
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
<?php
public function testing_update()
{
$new=new MemberTypes;
$new->AddOrUpdateMemberType('manager','Head of the','true','','membertype');
$membertypeid=mysql_insert_id();
$new->AddOrUpdateMemberType('commoner','Head of ','true',$membertypeid,'membertype');
$query=mysql_query("SELECT * FROM membertype WHERE membertypeid=$membertypeid");
$resActual=mysql_fetch_row($query);
$resExpected=array($membertypeid,'commoner','Head of the','true');
print_r($resActual);
print('<br>');
print_r($resExpected);
$this->assertEquals($resExpected,$resActual, "UPDATE FAILED");
}
?>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
you don't give much to work with. you posted the test, but not the subject code, or what is being returned, either as the error message or from your print statements. If I had to guess, I would say probably your keys are in a different order between the two arrays?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am getting:
$new->AddOrUpdateMemberType('commoner','Head of the','true',$membertypeid,'membertype');
$query=mysql_query("SELECT * FROM membertype WHERE membertypeid=$membertypeid");
$resActual=mysql_fetch_row($query);
$resExpected=array((string)$membertypeid,'commoner','Head of the','true');
TestCase MembersTypeTest->testing_update() failed: UPDATE FAILED expected Array, actual resActual in D:\Projects\pics4news.com\classes\membertypes_testcase.php:55
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]