Example #1
0
 function test_delete_client()
 {
     //Arrange
     $name = "Sasha";
     $id = null;
     $test_stylist = new Stylist($name, $id);
     $test_stylist->save();
     $c_name = "Garry Gergich";
     $phone = "503-472-8959";
     $stylist_id = $test_stylist->getId();
     $test_client = new Client($c_name, $phone, $id, $stylist_id);
     $test_client->save();
     $c_name2 = "Harvey the Wonder Hamster";
     $phone2 = "123-456-7890";
     $stylist_id2 = $test_stylist->getId();
     $test_client2 = new Client($c_name2, $phone2, $id, $stylist_id2);
     $test_client2->save();
     //Act
     $test_client->delete_client();
     $result = Client::getAll();
     //Assert
     $this->assertEquals($test_client2, $result[0]);
 }