本文整理汇总了PHP中Restaurant::updateName方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::updateName方法的具体用法?PHP Restaurant::updateName怎么用?PHP Restaurant::updateName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Restaurant
的用法示例。
在下文中一共展示了Restaurant::updateName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Cuisine
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;
}
示例2: Cuisine
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());
}