function test_deleteCuisineVenue() { //Arrange $type = "Italian"; $id = null; $test_cuisine = new Cuisine($type, $id); $test_cuisine->save(); $name = "Montage"; $cuisine_id = $test_cuisine->getId(); $rating = 4; $address = "1139 NW Elm Street"; $description = "Yum yum for my tum tum"; $test_venue = new Venue($name, $cuisine_id, $id, $rating, $address, $description); $test_venue->save(); //Act $test_cuisine->deleteCuisine(); //Assert $this->assertEquals([], Venue::getAll()); }
function test_GetReviews() { //cuisine $name = "Japanese"; $id = null; $test_cuisine = new Cuisine($name, $id); $test_cuisine->save(); $test_cuisine_id = $test_cuisine->getId(); //restaurant1 $name = "Good Fortune"; $description = "very tasty."; $address = "1111 SW 11th Ave"; $test_restaurant = new Restaurant($name, $id, $test_cuisine_id, $description, $address); $test_restaurant->save(); //review1 $username = "******"; $date = '0000-00-00'; $rating = 5; $comment = "good one."; $restaurant_id = $test_restaurant->getId(); $test_review = new Review($username, $date, $rating, $comment, $restaurant_id, $id); $test_review->save(); //review2 $username2 = "Jen"; $date2 = '1111-00-00'; $rating2 = 2; $comment2 = "Bad one."; $restaurant_id = $test_restaurant->getId(); $test_review2 = new Review($username2, $date2, $rating2, $comment2, $restaurant_id, $id); $test_review2->save(); $result = $test_restaurant->getReviews(); $this->assertEquals([$test_review, $test_review2], $result); }
function test_Delete() { //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 = $test_cuisine->getId(); $test_restaurant = new Restaurant($restaurant_name, $phone, $address, $website, $cuisine_id); $test_restaurant->save(); $restaurant_name2 = "Hot Lips Pizza"; $phone2 = '5035952342'; $address2 = "721 NW 9th Ave #150, Portland, OR 97209"; $website2 = "http://hotlipspizza.com/"; $test_restaurant2 = new Restaurant($restaurant_name2, $phone2, $address2, $website2, $cuisine_id); $test_restaurant2->save(); //Act $test_restaurant->delete(); //Assert $this->assertEquals([$test_restaurant2], Restaurant::getAll()); }
function testDelete() { //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(); $name2 = "Joses"; $cuisine_id = $test_cuisine->getId(); $price_range = 2; $neighborhood = "Buckman"; $test_restaurant2 = new Restaurant($name2, $id, $cuisine_id, $price_range, $neighborhood); $test_restaurant2->save(); //act $test_restaurant->delete(); //Assert $this->assertEquals([$test_restaurant2], Restaurant::getAll()); }
function testDelete() { //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(); $restaurant2 = "HobNob"; $address2 = "999 somewhere"; $phone2 = "234-555-5555"; $cuisine_id2 = $test_Cuisine->getId(); $test_restaurant2 = new Restaurant($restaurant, $address, $phone, $cuisine_id, $id); $test_restaurant2->save(); //Act $test_restaurant->delete(); //Assert $this->assertEquals([$test_restaurant2], Restaurant::getAll()); }
function test_RestarauntDelete() { //Arrange $cuisine_name = "Italian"; $id = null; $test_cuisine = new Cuisine($cuisine_name, $id); $test_cuisine->save(); $restaraunt_name = "Mamas Home Country Cookin"; $cuisine_id = $test_cuisine->getId(); $test_restaraunt = new Restaraunt($restaraunt_name, $id, $cuisine_id); $test_restaraunt->save(); $restaraunt_name2 = "Big Bobs Fried Alligator"; $test_restaraunt2 = new Restaraunt($restaraunt_name2, $id, $cuisine_id); $test_restaraunt2->save(); //Act $test_restaraunt->delete(); //Assert $this->assertEquals([$test_restaraunt2], Restaraunt::getAll()); }
function test_getRestaurants() { //Arrange $test_cuisine = new Cuisine("Lebanese", false, 5); $test_cuisine->save(); $test_cuisine_id = $test_cuisine->getId(); $test_restaurant1 = new Restaurant("Bens Bulkogi", 50, "eastside", true, $test_cuisine_id); $test_restaurant1->save(); //var_dump($test_restaurant1); $test_restaurant2 = new Restaurant("Marios Pizza Hole", 35, "Hole", false, $test_cuisine_id); $test_restaurant2->save(); //Act $result = $test_cuisine->getRestaurants(); //Assert $this->assertEquals([$test_restaurant1, $test_restaurant2], $result); //$this->assertEquals([], $result); }
function test_DeleteCuisineRestaurants() { //Arrange //cuisine $name = "Japanese"; $id = null; $test_cuisine = new Cuisine($name, $id); $test_cuisine->save(); //restaurant $name = "Good Fortune"; $cuisine_id = $test_cuisine->getId(); $description = "very tasty."; $address = "1111 SW 11th Ave"; $test_restaurant = new Restaurant($name, $id, $cuisine_id, $description, $address); $test_restaurant->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Restaurant::getAll()); }
function testDeleteCuisineRestaurants() { //Arrange $name = "Italian"; $id = null; $test_cuisine = new Cuisine($name, $id); $test_cuisine->save(); $name = "Piazza Italia"; $cuisine_id = $test_cuisine->getId(); $test_restaurant = new Restaurant($name, $id, $cuisine_id, $rating); $test_restaurant->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Restaurant::getAll()); }
function testDeleteCuisineRestaraunts() { //Arrange $cuisine_name = "Italian"; $id = null; $test_cuisine = new Cuisine($cuisine_name, $id); $test_cuisine->save(); $restaraunt_name = "Big Bubba/'s Tuscan Pizza"; $cuisine_id = $test_cuisine->getId(); $test_restaraunt = new Restaraunt($restaraunt_name, $id, $cuisine_id); $test_restaraunt->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Restaraunt::getAll()); }
function test_DeleteCuisineRestaurants() { //Arrange $id = null; $cuisine_type = "Brazilian"; $test_cuisine_type = new Cuisine($id, $cuisine_type); $name = "Peles Brazilian Buffet"; $phone = "510-814-2012"; $address = "190b Mississippi St, Portland, OR 97221"; $hours = "9am - ?"; $test_cuisine_type_id = $test_cuisine_type->getId(); $test_restaurant = new Restaurant($id, $name, $phone, $address, $hours, $test_cuisine_type_id); $test_restaurant->save(); //Act $test_cuisine_type->delete(); //Assert $this->assertEquals([], Restaurant::getAll()); }
function test_deleteReviews() { $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_restaurant2 = new Restaurant($restaurant_name2, $location2, $description2, $price2, $cuisine_id2); $test_restaurant2->save(); $user = "******"; $stars = 3; $headline = "It is aight."; $body = "Yeah, pretty aight bro"; $restaurant_id = $test_restaurant->getId(); $test_review = new Review($user, $stars, $headline, $body, $restaurant_id); $test_review->save(); $user2 = "6969babygirl"; $stars2 = 3; $headline2 = "XOXO"; $body2 = "I cant even"; $restaurant_id2 = $test_restaurant->getId(); $test_review2 = new Review($user2, $stars2, $headline2, $body2, $restaurant_id2); $test_review2->save(); $test_restaurant->delete(); $result = Review::getAll(); //var_dump($result); $this->assertEquals([], $result); }
function test_cuisine_delete() { $style = "Thai"; $test_cuisine = new Cuisine($style); $test_cuisine->save(); $style2 = "burgers"; $test_cuisine2 = new Cuisine($style2); $test_cuisine2->save(); $name = "Pok Pok"; $category_id = $test_cuisine->getId(); $test_restaurant = new Restaurant($name, $category_id); $test_restaurant->save(); $name2 = "Dicks"; $category_id2 = $test_cuisine2->getId(); $test_restaurant2 = new Restaurant($name2, $category_id2); $test_restaurant2->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([$test_restaurant2], Restaurant::getAll()); }
function testGetRestaurants() { //Arrange $type = "Italian"; $id = null; $test_cuisine = new Cuisine($type, $id); $test_cuisine->save(); $test_cuisine_id = $test_cuisine->getId(); $description = "OK Chinese food"; $name = "City Chinese"; $test_restaurant = new Restaurant($description, $id, $test_cuisine_id, $name); $test_restaurant->save(); $description2 = "OK Mexican"; $name2 = "City Mexican"; $test_restaurant2 = new Restaurant($description2, $id, $test_cuisine_id, $name2); $test_restaurant2->save(); //Act $result = $test_cuisine->getRestaurants(); //Assert $this->assertEquals([$test_restaurant, $test_restaurant2], $result); }
function test_deleteOne() { //Arrange $cuisine = "Pizza"; $test_cuisine = new Cuisine($cuisine); $test_cuisine->save(); //Act $result = Cuisine::find($test_cuisine->getId()); $result->deleteOne(); //Assert $this->assertEquals($test_cuisine, $result); }
function test_update() { $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(); $new_place_name = "Very Happy House"; $new_address = "5000 N Interstate Ave, Portland OR 97217"; $new_phone = "503-287-9000"; $test_restaurant->update($new_place_name, $new_address, $new_phone); $this->assertEquals("Very Happy House", $test_restaurant->getPlaceName()); $this->assertEquals("5000 N Interstate Ave, Portland OR 97217", $test_restaurant->getAddress()); $this->assertEquals("503-287-9000", $test_restaurant->getPhone()); }
function test_restaurant_getStars() { //Arrange $style = "Thai"; $test_cuisine = new Cuisine($style); $test_cuisine->save(); $name = "Pok Pok"; $category_id = $test_cuisine->getId(); $stars = 5; $test_restaurant = new Restaurant($name, $category_id, null, $stars); $test_restaurant->save(); $name2 = "Dicks"; $stars2 = 3; $category_id2 = $test_cuisine->getId(); $test_restaurant2 = new Restaurant($name2, $category_id, null, $stars2); $test_restaurant2->save(); //Act $result = Restaurant::getAll(); //Assert $this->assertEquals(5, $result[0]->getStars()); }
function test_find() { //Arrange $name = "burgers"; $test_cuisine = new Cuisine($name); $test_cuisine->save(); //Act $result = Cuisine::find($test_cuisine->getId()); //Assert $this->assertEquals($test_cuisine, $result); }
function test_getRestaurants() { $name = "Chinese"; $id = null; $test_cuisine = new Cuisine($name, $id); $test_cuisine->save(); $address = "4234 N Interstate Ave, Portland OR 97217"; $phone = "503-287-9740"; $cuisine_id = $test_cuisine->getId(); $place_name = "Happy House"; $test_restaurant = new Restaurant($place_name, $id, $address, $phone, $cuisine_id); $test_restaurant->save(); $place_name2 = "Golden Dragon"; $test_restaurant2 = new Restaurant($place_name2, $id, $address, $phone, $cuisine_id); $test_restaurant2->save(); $result = $test_cuisine->getRestaurants(); $this->assertEquals([$test_restaurant, $test_restaurant2], $result); }
function test_sort() { //Arrange $restaurant_name = "McDonalds"; $id = null; $test_restaurant = new Restaurant($restaurant_name, $id); $test_restaurant->save(); $cuisine_name2 = "Tacos2"; $restaurant_id2 = $test_restaurant->getId(); $test_cuisine2 = new Cuisine($cuisine_name2, $id, $restaurant_id2); $test_cuisine2->save(); $cuisine_name = "Tacos"; $restaurant_id = $test_restaurant->getId(); $test_cuisine = new Cuisine($cuisine_name, $id, $restaurant_id); $test_cuisine->save(); //Act $id = $test_cuisine->getId(); $result = Cuisine::getAll(); //Assert $this->assertEquals([$test_cuisine, $test_cuisine2], $result); }
function testGetRestaurants() { $type = "Thai"; $id = null; $test_Cuisine = new Cuisine($type, $id); $test_Cuisine->save(); $test_Restaurant = new Restaurant("Pok Pok", $id, "555-456-2345", "123 abcd street", "http://www.helloworld.com", $test_Cuisine->getId()); $test_Restaurant->save(); $test_Restaurant2 = new Restaurant("Whiskey Soda Lounge", $id, "555-555-5555", "678 DEF street", "http://www.pokpok.com", $test_Cuisine->getId()); $test_Restaurant2->save(); $result = $test_Cuisine->getRestaurants(); $this->assertEquals([$test_Restaurant, $test_Restaurant2], $result); }
function test_deleteCuisine() { //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($id, $name, $phone, $price, $cuisine_id); $test_restaurant->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Cuisine::getAll()); }
function test_find() { //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 $result = Restaurant::find($test_restaurant->getId()); //Assert $this->assertEquals($test_restaurant, $result); }
function testUpdate() { //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(); // $id = null; $test_restaurant = new Restaurant($name, $phone, $price, $cuisine_id); $test_restaurant->save(); $new_name = "Escargot"; $new_phone = "666-666-6666"; $new_price = "\$\$\$"; // $cuisine_id = 1; // $new_id = null; $new_test_restaurant = new Restaurant($new_name, $new_phone, $new_price, $cuisine_id, $test_restaurant->getId()); // $new_test_restaurant->save(); // var_dump($new_test_restaurant); //Act $test_restaurant->update($new_name, $new_phone, $new_price); //Assert $this->assertEquals($test_restaurant, $new_test_restaurant); }
function testDeleteCuisineRestaurants() { //Arrange $flavor = "Pizza"; $id = null; $test_cuisine = new Cuisine($flavor, $id); $test_cuisine->save(); $name = "Pizza Party"; $phone_number = "123-123-1234"; $address = "1234 Pepporoni Lane"; $cuisine_id = $test_cuisine->getId(); $test_restaurant = new Restaurant($name, $phone_number, $address, $id, $cuisine_id); $test_restaurant->save(); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Restaurant::getAll()); }
function test_DeleteCuisineRestaurantsReviews() { //Arrange //cuisine $name = "Japanese"; $id = null; $test_cuisine = new Cuisine($name, $id); $test_cuisine->save(); //restaurant $name = "Good Fortune"; $cuisine_id = $test_cuisine->getId(); $description = "very tasty."; $address = "1111 SW 11th Ave"; $test_restaurant = new Restaurant($name, $id, $cuisine_id, $description, $address); $test_restaurant->save(); //review $username = "******"; $date = 00 - 00 - 00; $rating = 5; $comment = "good one."; $restaurant_id = $test_restaurant->getId(); $test_review = new Review($username, $date, $rating, $comment, $restaurant_id, $id); //Act $test_cuisine->delete(); //Assert $this->assertEquals([], Review::getAll()); }
function test_deleteVenue() { //Arrange $type = "Thai"; $id = null; $test_cuisine = new Cuisine($type, $id); $test_cuisine->save(); $test_cuisine_id = $test_cuisine->getId(); $name = "Mai Thai"; $address = "1139 NW Elm Street"; $description = "Yum yum for my tum tum"; $rating = 3; $name2 = "Screen Door"; $address2 = "19849 SW Santee Court"; $description2 = "Huge lines. Not worth it."; $rating2 = 4; $test_venue = new Venue($name, $test_cuisine_id, $id, $rating, $address, $description); $test_venue2 = new Venue($name2, $test_cuisine_id, $id, $rating2, $address2, $description2); $test_venue->save(); $test_venue2->save(); //Act $test_venue->deleteVenue(); //Assert $this->assertEquals([$test_venue2], Venue::getAll()); }
function testUpdate() { //Arrange $flavor = "Pizza"; $id = null; $test_cuisine = new Cuisine($flavor, $id); $name = "Pizza Party"; $phone_number = "123-456-7890"; $address = "1234 Pepperoni Lane"; $cuisine_id = $test_cuisine->getId(); $test_restaurant = new Restaurant($name, $phone_number, $address, $id, $cuisine_id); $test_restaurant->save(); $new_name = "Burger Bash"; //Act $test_restaurant->update($new_name); //Assert $this->assertEquals("Pizza", $test_cuisine->getFlavor()); }
function test_DeleteRestaurants() { //Arrange $id = null; $cuisine_type = "Brazilian"; $test_cuisine_type = new Cuisine($id, $cuisine_type); $test_cuisine_type->save(); $name = "Peles Brazilian Buffet"; $phone = "510-814-2012"; $address = "190b Mississippi St, Portland, OR 97221"; $hours = "9am - ?"; $test_cuisine_type_id = $test_cuisine_type->getId(); $test_restaurant = new Restaurant($id, $name, $phone, $address, $hours, $test_cuisine_type_id); $test_restaurant->save(); $name2 = "Olive Garden"; $phone2 = "(403) 232-1091"; $address2 = "101 Olive Garden Way, Portland, OR 97221"; $hours2 = "8am - 10pm"; $test_restaurant2 = new Restaurant($id, $name2, $phone2, $address2, $hours2, $test_cuisine_type_id); $test_restaurant2->save(); //Act $test_restaurant->delete(); //Assert $result = Restaurant::getAll(); $this->assertEquals([$test_restaurant2], $result); }
function test_find() { //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(); $name2 = "Ristorante Roma"; $rating = 1; $test_restaurant2 = new Restaurant($name2, $id, $cuisine_id, $rating); $test_restaurant2->save(); //Act $result = Restaurant::find($test_restaurant->getId()); //Assert $this->assertEquals($test_restaurant, $result); }