function test_updateName() { //Arrange $test_name = "Toms Tomatos "; $test_seats = 15; $test_location = "Farmville"; $test_evenings = true; $test_cuisine = new Cuisine("Mexican", true, 1); $test_cuisine->save(); $test_restaurant = new Restaurant($test_name, $test_seats, $test_location, $test_evenings, $test_cuisine->getId()); $test_restaurant->save(); //Act $new_name = "Annie Applesauce"; $test_restaurant->updateName($new_name); $result = Restaurant::getAll(); //Assert $this->assertEquals($new_name, $result[0]->getName()); //if $new_name == $result[0] return true; }
function test_UpdateName() { //arrange $type = "Tacos"; $id = null; $test_cuisine = new Cuisine($type, $id); $test_cuisine->save(); $name = "Nathans"; $cuisine_id = $test_cuisine->getId(); $price_range = 1; $neighborhood = "Felony Flats"; $test_restaurant = new Restaurant($name, $id, $cuisine_id, $price_range, $neighborhood); $test_restaurant->save(); $new_name = "Natalies"; //act $test_restaurant->updateName($new_name); //assert $this->assertEquals("Natalies", $test_restaurant->getName()); }