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); }
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); }
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); }
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-->
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); }
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>
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()); }
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()); }
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()); }