当前位置: 首页>>代码示例>>PHP>>正文


PHP Restaurant::getName方法代码示例

本文整理汇总了PHP中Restaurant::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Restaurant::getName方法的具体用法?PHP Restaurant::getName怎么用?PHP Restaurant::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Restaurant的用法示例。


在下文中一共展示了Restaurant::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSetRestaurantName

 function testSetRestaurantName()
 {
     //arrange
     $name = "Taco Hell";
     $test_restaurant = new Restaurant($name);
     //act
     $test_restaurant->setName("Taco Hell");
     $result = $test_restaurant->getName();
     //assert
     $this->assertEquals("Taco Hell", $result);
 }
开发者ID:Camolot,项目名称:allergen_avoider,代码行数:11,代码来源:RestaurantTest.php

示例2: Cuisine

 function test_getName()
 {
     $type = "Thai";
     $id = null;
     $test_Cuisine = new Cuisine($type, $id);
     $test_Cuisine->save();
     $name = "Pok Pok";
     $phone = "555-456-2345";
     $address = "123 abcd street";
     $website = "http://www.helloworld.com";
     $cuisine_id = $test_Cuisine->getId();
     $test_Restaurant = new Restaurant($name, $id, $phone, $address, $website, $cuisine_id);
     $result = $test_Restaurant->getName();
     $this->assertEquals($name, $result);
 }
开发者ID:jeffaustin81,项目名称:Restaurants,代码行数:15,代码来源:RestaurantTest.php

示例3: Cuisine

 function test_getName()
 {
     //Arrange
     $test_name = "Mario's Pizza";
     $test_seats = 100;
     $test_location = "Downtown";
     $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
     $result = $test_restaurant->getName();
     //Assert
     $this->assertEquals($test_name, $result);
 }
开发者ID:neostoic,项目名称:food_finder,代码行数:16,代码来源:RestaurantTest.php

示例4:

            echo ", ";
        }
        ?>
<a href="#" title="View all restaurants in <?php 
        echo $cuisine->getName();
        ?>
" rel="tag"><?php 
        echo $cuisine->getName();
        ?>
</a><?php 
    }
    ?>
	</span>

		<h2 class="post-title"><a href="#"><?php 
    echo $restaurant->getName();
    ?>
<span class="plus"><span>+</span> </span></a></h2>
		
		<!--BEGIN .post-content -->
		<div class="post-content">
			<p><?php 
    echo $restaurant->getAddress();
    ?>
</p>
		<!--END .post-content -->
		</div>
		<a class="read-more" href="#">Read More<span class="plus"><span>+</span> </span></a>
		<span class="meta-published">306 days ago</span>

	<!--END .hentry-->  
开发者ID:jainankit,项目名称:suggstme,代码行数:31,代码来源:search.php

示例5: Cuisine

 function test_update()
 {
     $name = "Asian";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     $restaurant_name = "The Golden Duck";
     $location = "898 SW 5th Ave, Portland, OR";
     $description = "A Chill Asian experince";
     $price = "\$\$";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($restaurant_name, $location, $description, $price, $cuisine_id);
     $test_restaurant->save();
     $restaurant_name2 = "The Red Dragon";
     $location2 = "899 SW 5th Ave, Portland, OR";
     $description2 = "A Intense Asian experince";
     $price2 = "\$\$\$";
     $cuisine_id2 = $test_cuisine->getId();
     $test_restaurant->update($restaurant_name2, $location2, $description2, $price2, $cuisine_id2);
     $result = $test_restaurant->getName();
     $this->assertEquals("The Red Dragon", $result);
 }
开发者ID:juliocesardiaz,项目名称:Best-restaurants,代码行数:22,代码来源:RestaurantTest.php

示例6: Recommendation

include "inc/includes.php";
require_once "inc/Restaurant.php";
require_once "inc/Cuisine.php";
require_once "inc/Filter.php";
global $USER_LOGGED_IN;
global $USERID;
// Generate the default recommendations if user is logged in.
if ($USER_LOGGED_IN) {
    $recommendation = new Recommendation($USERID);
    $filter = new Filter();
    $filter->setCuisine(7);
    $result = $recommendation->getFilteredWithCategory(2, $filter);
    while ($reco = mysql_fetch_array($result)) {
        $restaurant = new Restaurant($reco['resId']);
        echo $restaurant->getName() . "," . $restaurant->getAddress();
        $cuisines = $restaurant->getCategories();
        foreach ($cuisines as $cuisine) {
            echo $cuisine->getName();
        }
    }
}
?>
<html>
  <body>
  <?php 
getFacebookWidget();
?>
  </body>
</html>
开发者ID:jainankit,项目名称:suggstme,代码行数:29,代码来源:fb.php

示例7: Cuisine

 function test_update()
 {
     //Arrange
     $name = "Drinks";
     $id = null;
     $test_Cuisine = new Cuisine($name, $id);
     $test_Cuisine->save();
     $restaurant = "Aalto";
     $address = "123 Belmont";
     $phone = "123-456-7890";
     $cuisine_id = $test_Cuisine->getId();
     $test_restaurant = new Restaurant($restaurant, $address, $phone, $cuisine_id, $id);
     $test_restaurant->save();
     $new_restaurant_name = "HobNob";
     //Act
     $test_restaurant->update($new_restaurant_name);
     //Assert
     $this->assertEquals("HobNob", $test_restaurant->getName());
 }
开发者ID:sammartinez,项目名称:restaurant_project,代码行数:19,代码来源:RestaurantTest.php

示例8: 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());
 }
开发者ID:nathanhwyoung,项目名称:restaurant,代码行数:19,代码来源:RestaurantTest.php

示例9: Cuisine

 function test_update()
 {
     //Arrange
     $cuisine_type = "Italian";
     $id = null;
     $test_cuisine = new Cuisine($cuisine_type, $id);
     $test_cuisine->save();
     $name = "Taco Restaurant";
     $phone = "(503) 777-9097";
     $address = "7000 Beaverton Hillsdale HWY, Portland, OR 97221";
     $hours = "7am - 2am";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($id, $name, $phone, $address, $hours, $cuisine_id);
     $test_restaurant->save();
     $new_name = "Taco Bell";
     // $new_phone = "(402) 231-0911";
     // $new_address = "902 Beaverton Hillsdale Hwy, Portland, OR 97211";
     // $new_hours = "8am - 10pm";
     //Act
     $test_restaurant->update($new_name);
     //Assert
     $this->assertEquals("Taco Bell", $test_restaurant->getName());
 }
开发者ID:austinblanchard,项目名称:best_restaurants,代码行数:23,代码来源:RestaurantTest.php


注:本文中的Restaurant::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。