當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Restaurant::getCuisineId方法代碼示例

本文整理匯總了PHP中Restaurant::getCuisineId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Restaurant::getCuisineId方法的具體用法?PHP Restaurant::getCuisineId怎麽用?PHP Restaurant::getCuisineId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Restaurant的用法示例。


在下文中一共展示了Restaurant::getCuisineId方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Cuisine

 function test_getCuisineId()
 {
     $name = "Chinese";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     $place_name = "Happy House";
     $address = "4234 N Interstate Ave, Portland OR 97217";
     $phone = "503-287-9740";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($place_name, $id, $address, $phone, $cuisine_id);
     $test_restaurant->save();
     $result = $test_restaurant->getCuisineId();
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:jschold,項目名稱:Best_Restaurants,代碼行數:15,代碼來源:RestaurantTest.php

示例2: Cuisine

 function test_getCuisineId()
 {
     $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();
     $result = $test_restaurant->getCuisineId();
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:juliocesardiaz,項目名稱:Best-restaurants,代碼行數:16,代碼來源:RestaurantTest.php

示例3: testGetCuisineId

 function testGetCuisineId()
 {
     //Arrange
     $type = "Italian";
     $id = null;
     $test_cuisine = new Cuisine($type, $id);
     $test_cuisine->save();
     $name = "City Chinese";
     $description = "OK Chinese food";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($description, $id, $cuisine_id, $name);
     $test_restaurant->save();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:r-hills,項目名稱:Restaurant_Reviews,代碼行數:17,代碼來源:RestaurantTest.php

示例4: Cuisine

 function test_getCuisineId()
 {
     //Arrange
     $name = "Italian";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     $name = "Piazza Italia";
     $rating = 1;
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($name, $id, $cuisine_id, $rating);
     $test_restaurant->save();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:anniehoogendoorn,項目名稱:BestRestaurants,代碼行數:17,代碼來源:RestaurantTest.php

示例5: Cuisine

 function test_getCuisineId()
 {
     //cuisine
     $name = "Japanese";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     //restaurant
     $name = "Good Fortune";
     $description = "very tasty.";
     $address = "1111 SW 11th Ave";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($name, $id, $cuisine_id, $description, $address);
     $test_restaurant->save();
     $result = $test_restaurant->getCuisineId();
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:Camolot,項目名稱:restaurants,代碼行數:17,代碼來源:RestaurantTest.php

示例6: Cuisine

 function test_getCuisineId()
 {
     //Arrange
     $flavor = "Burgers";
     $id = null;
     $test_cuisine = new Cuisine($flavor, $id);
     $test_cuisine->save();
     $name = "Burger Bash";
     $phone_number = "555-666-7777";
     $address = "8020 Ground Chuck";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($name, $phone_number, $address, $id, $cuisine_id);
     $test_restaurant->save();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:JordanNavratil,項目名稱:Best_Restaurant,代碼行數:18,代碼來源:RestaurantTest.php

示例7: Cuisine

 function test_getCuisineId()
 {
     //Arrange
     $type = "french";
     $id = null;
     $test_cuisine = new Cuisine($type, $id);
     $test_cuisine->save();
     $name = "Petit Provence";
     $phone = "555-555-5555";
     $price = "\$\$";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($name, $phone, $price, $cuisine_id);
     $test_restaurant->save();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:kylepratuch,項目名稱:restaurants_by_cuisine,代碼行數:18,代碼來源:RestaurantTest.php

示例8: Cuisine

 function test_getCategoryId()
 {
     //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();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:sammartinez,項目名稱:restaurant_project,代碼行數:18,代碼來源:RestaurantTest.php

示例9: Cuisine

 function test_getCuisineId()
 {
     //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();
     //act
     $result = $test_restaurant->getCuisineId();
     //assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:nathanhwyoung,項目名稱:restaurant,代碼行數:18,代碼來源:RestaurantTest.php

示例10: Cuisine

 function test_getCuisineId()
 {
     $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->getCuisineId();
     $this->assertEquals($cuisine_id, $result);
 }
開發者ID:jeffaustin81,項目名稱:Restaurants,代碼行數:15,代碼來源:RestaurantTest.php

示例11: Cuisine

 function test_restaurant_update()
 {
     //Arrange
     $style = "Thai";
     $test_cuisine = new Cuisine($style);
     $test_cuisine->save();
     $name = "Pok Pok";
     $cuisine_id = $test_cuisine->getId();
     $stars = 4;
     $website = "www.pokpokpdx.com";
     $phone = "503 232 1387";
     $tr = new Restaurant($name, $cuisine_id, $stars, $website, $phone);
     $tr->save();
     $new_name = "Pok Pok Noi";
     $new_cuisine_id = $test_cuisine->getId();
     $new_id = $new_stars = 7;
     $new_website = "balls";
     $new_phone = "503 555 5555";
     //Act
     $tr->updateRestaurant($new_name, $tr->getCuisineId(), $tr->getID(), $new_stars, $new_website, $new_phone);
     //Assert
     $this->assertEquals(7, $tr->getStars(), "OH NO");
 }
開發者ID:umamiMike,項目名稱:restaurantApp,代碼行數:23,代碼來源:RestaurantTest.php

示例12: Cuisine

 function test_getCuisineId()
 {
     //Arrange
     $name = "American";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     $restaurant_name = "VQ";
     $phone = '5032277342';
     $address = "1220 SW 1st Ave, Portland, OR 97204";
     $website = "http://www.veritablequandary.com/";
     $cuisine_id = 1;
     $id = null;
     $test_restaurant = new Restaurant($restaurant_name, $phone, $address, $website, $cuisine_id, $id);
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:alexdbrown,項目名稱:best_restaurant,代碼行數:19,代碼來源:RestaurantTest.php

示例13: array

    return $app['twig']->render('cuisine_edit.html.twig', array('cuisine' => $cuisine));
});
$app->patch("/cuisines/{id}", function ($id) use($app) {
    $cuisine = Cuisine::find($id);
    $cuisine->update($_POST['type']);
    return $app['twig']->render('cuisine.html.twig', array('cuisine' => $cuisine, 'restaurants' => Restaurant::getAll()));
});
$app->delete("/cuisines/{id}", function ($id) use($app) {
    $cuisine = Cuisine::find($id);
    $cuisine->delete();
    return $app['twig']->render('index.html.twig', array('cuisines' => Cuisine::getAll()));
});
$app->post("/restaurants", function () use($app) {
    $restaurant = new Restaurant($_POST['name'], $_POST['location'], $_POST['description'], $_POST['price'], $_POST['cuisine_id']);
    $restaurant->save();
    $cuisine = Cuisine::find($restaurant->getCuisineId());
    return $app['twig']->render('cuisine.html.twig', array('cuisine' => $cuisine, 'restaurants' => Restaurant::getAll()));
});
$app->get("/restaurants/{id}", function ($id) use($app) {
    $restaurant = Restaurant::find($id);
    return $app['twig']->render('restaurant.html.twig', array('restaurant' => $restaurant, 'reviews' => Review::getAll()));
});
$app->get("/restaurants/{id}/edit", function ($id) use($app) {
    $restaurant = Restaurant::find($id);
    return $app['twig']->render('restaurant_edit.html.twig', array('restaurant' => $restaurant));
});
$app->patch("/restaurants/{id}", function ($id) use($app) {
    $restaurant = Restaurant::find($id);
    $restaurant->update($_POST['name'], $_POST['location'], $_POST['description'], $_POST['price'], $_POST['cuisine_id']);
    return $app['twig']->render('restaurant.html.twig', array('restaurant' => $restaurant, 'reviews' => Review::getAll()));
});
開發者ID:juliocesardiaz,項目名稱:Best-restaurants,代碼行數:31,代碼來源:app.php

示例14: Cuisine

 function test_getCuisineId()
 {
     //Arrange
     $cuisine_type = "Italian";
     $id = null;
     $test_cuisine = new Cuisine($cuisine_type, $id);
     $test_cuisine->save();
     $id2 = null;
     $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($id2, $name, $phone, $address, $hours, $cuisine_id);
     $test_restaurant->save();
     //Act
     $result = $test_restaurant->getCuisineId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
開發者ID:austinblanchard,項目名稱:best_restaurants,代碼行數:20,代碼來源:RestaurantTest.php


注:本文中的Restaurant::getCuisineId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。