static function find($search_id) { $found_stylist = null; $stylists = stylist::getAll(); foreach ($stylists as $stylist) { $stylist_id = $stylist->getId(); if ($stylist_id == $search_id) { $found_stylist = $stylist; } } return $found_stylist; }
function test_deleteClient() { //Arrange $name = "Tessa"; $id = null; $test_stylist = new stylist($name, $id); $test_stylist->save(); $test_stylist_id = $test_stylist->getId(); $name = "Mai"; $description = "Scary"; $visits = 3; $name2 = "Doory"; $description2 = "Not worth it."; $visits2 = 4; $test_client = new client($name, $test_stylist_id, $id, $visits, $description); $test_client2 = new client($name2, $test_stylist_id, $id, $visits2, $description2); $test_client->save(); $test_client2->save(); //Act $test_client->deleteClient(); //Assert $this->assertEquals([$test_client2], client::getAll()); }