public function test_scrape_another_recipe_with_ingredient_and_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setImage('http://assets.epicurious.com/photos/577e81394f2c1eb16e3d5851/master/pass/plum-steusel-coffeecake-hero-07072016.jpg');
     $recipe->setName('Plum Streusel Coffeecake');
     $recipe->setPublisher('Gourmet');
     $recipe->setRecipeCategories(['Cake', 'Food Processor', 'Mixer', 'Dairy', 'Breakfast', 'Brunch', 'Dessert', 'Bake', 'Vegetarian', 'Plum', 'Walnut', 'Fall', 'Gourmet']);
     $recipe->setRecipeIngredients([['title' => 'For Streusel', 'data' => ['1 cup all-purpose flour', '1/2 cup firmly packed light brown sugar', '1/2 cup walnuts', '3/4 stick (6 tablespoons) unsalted butter, cut into pieces and softened', '1 teaspoon cinnamon', '1/4 teaspoon freshly grated nutmeg']], ['title' => 'For Cake Batter', 'data' => ['1 stick (1/2 cup) unsalted butter, softened', '3/4 cup granulated sugar', '2 large eggs', '1 teaspoon vanilla', '1 1/4 cups all-purpose flour', '1 teaspoon baking powder', '1/2 teaspoon salt', '3/4 pound plums (4 to 5 medium), sliced', 'confectioners\' sugar for sifting over cake']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Preheat oven to 350 °F. and butter and flour a 9-inch round or square baking pan at least 2 inches deep.']], ['title' => 'Make Streusel', 'data' => ['In a food processor pulse together streusel ingredients until combined well and crumbly.']], ['title' => 'Make Cake Batter', 'data' => ['In a bowl with an electric mixer beat butter with sugar until light and fluffy and add eggs, 1 at a time, beating well after each addition, and vanilla. Sift in flour with baking powder and salt and beat until just combined.', 'Spread cake batter in pan, smoothing top, and arrange plum slices over it in slightly overlapping concentric circles. Sprinkle streusel over plum slices and bake cake in middle of oven 1 hour, or until a tester comes out clean. Coffeecake may be made 1 week ahead: Cool cake completely in pan on a rack and freeze, wrapped well in plastic wrap and foil. Reheat cake, unwrapped but not thawed, in a preheated 350 °F. oven until heated through, 35 to 40 minutes. Cool cake slightly on a rack and sift confectioners\' sugar over it. Serve coffeecake warm or at room temperature.']]]);
     $recipe->setUrl('http://www.epicurious.com/recipes/food/views/plum-streusel-coffeecake-13137');
     $crawler = $this->client->request('GET', 'http://www.epicurious.com/recipes/food/views/plum-streusel-coffeecake-13137');
     $scraper = new EpicuriousCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Leetal Arazi');
     $recipe->setDescription('These luscious doughnuts are crispy on the outside and very fluffy and airy on the inside. They\'re usually served dipped in sugar or honey, but Leetal and Ron Arazi love to serve them with a saffron and cardamom syrup.');
     $recipe->setImage('http://cdn-image.foodandwine.com/sites/default/files/styles/551x551/public/201412-xl-sfinj-moroccan-doughnuts.jpg?itok=ClS4JKuU');
     $recipe->setName('Sfinj (Moroccan Doughnuts)');
     $recipe->setPrepTime(new DateInterval('PT30M'));
     $recipe->setRecipeCategories(['Winter', 'Hannukah', 'Holiday Open House', 'Moroccan', 'Desserts', 'Vegetarian', 'Breakfast', 'Brunch']);
     $recipe->setRecipeIngredients([['title' => 'Sugar Syrup', 'data' => ['1 cup water', '1 cup sugar', '5 cardamom pods', 'Pinch of saffron threads']], ['title' => 'Doughnuts', 'data' => ['8 cups unbleached all-purpose flour', '2 tablespoons yeast', '2 teaspoons baking powder', '2 teaspoons salt', '1 teaspoon sugar', '3 to 4 cups water', 'Canola oil, for frying']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Make the Sugar Syrup In a medium saucepan, combine all of the ingredients and bring to a boil. Reduce the heat and simmer until the syrup is the consistency of honey. (To test, place a few small plates in the freezer and drizzle a bit of the syrup on them throughout the cooking process.) Remove from the heat and let cool.', 'Make the Doughnuts In a large bowl, combine all of the dry ingredients. Add 3 1/2 cups of water and mix thoroughly; the dough should be loose and sticky and doesn’t need to hold its shape. Adjust the consistency if needed with the rest of the water. Cover the dough with cling plastic wrap and let rest for 30 minutes.', 'Make the Doughnuts In the bowl, using your hands, fold the dough over onto itself few times. Cover and let rise for 30 minutes, or until it doubles in volume. In a deep pan, heat 3 inches high of canola oil.', 'Make the Doughnuts Wet your hands and cut a piece of dough the size of 2 golf balls. With 2 fingers quickly make a hole in the center and stretch it a little to form a ring shape. Repeat to form the remaining doughnuts.', 'Make the Doughnuts Immediately and gently put the doughnuts in the oil and fry over moderate heat until golden on both sides. Drain the doughnuts on paper towels.', 'Make the Doughnuts Serve the sfinj immediately and let your guests drizzle them with the sugar syrup.']]]);
     $recipe->setTotalTime(new DateInterval('PT1H30M'));
     $recipe->setUrl('http://www.foodandwine.com/recipes/sfinj-moroccan-doughnuts');
     $crawler = $this->client->request('GET', 'http://www.foodandwine.com/recipes/sfinj-moroccan-doughnuts');
     $scraper = new FoodAndWineCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
예제 #3
0
 public function test_scrape_another_standard_recipe()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Better Homes and Gardens');
     $recipe->setDescription('Flavors meld beautifully when you roast the apples alongside the seasoned pork in this easy, low-calorie dinner recipe.');
     $recipe->setImage('http://images.meredith.com/content/dam/bhg/Images/recipe/43/R137745.jpg.rendition.largest.ss.jpg');
     $recipe->setName('Roasted Pork with Apples');
     $recipe->setPrepTime(new DateInterval('PT15M'));
     $recipe->setRecipeCategories(['Diabetic Recipes', 'Dinner Recipes', 'Fruit Salad Recipes', 'Healthy Breakfast Recipes', 'Healthy Dinner Recipes', 'Healthy Lunch Recipes', 'Healthy Recipes', 'Heart-Healthy Recipes', 'Low Fat Recipes', 'Pork Recipes', 'Quick and Easy Healthy Recipes', 'Quick and Easy Recipes', 'Seasonal Recipes']);
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['1 teaspoon snipped fresh sage or 1/2 teaspoon dried sage, crushed', '1/4 teaspoon salt', '1/4 teaspoon coarsely ground black pepper', '1 1 pound pork tenderloin', '1 tablespoon canola oil', '1 medium red onion, cut into thin wedges', '3 medium (1 pound) cooking apples (such as Granny Smith or Jonathan), cored and cut into 1/2-inch thick wedges', '2/3 cup apple juice or apple cider', 'Fresh sage sprigs (optional)']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['In a small bowl, combine the snipped sage, salt, and pepper; rub on all sides of tenderloin. In a large skillet brown tenderloin in hot oil over medium heat, turning to brown all sides.', 'Transfer pork to a shallow roasting pan. Add onion to pan around pork. Roast, uncovered, at 425 degrees F for 10 minutes. Stir in apples; roast for 10 to 15 minutes more or until pork internal temperature registers 155 degrees F on instant read thermometer and juices run clear.', 'Transfer pork and apple mixture to serving platter; cover with foil. Let stand for 10 minutes before slicing (temperature of the meat will rise 5 degrees F while it stands).', 'In a small saucepan bring apple juice to a boil; simmer gently, uncovered, for 8 to 10 minutes or until reduced to 1/4 to 1/3 cup. Drizzle over meat and apple mixture. If desired, garnish with additional sage sprigs.']]]);
     $recipe->setRecipeYield('4');
     $recipe->setUrl('http://www.bhg.com/recipe/pork/roasted-pork-with-apples/');
     $crawler = $this->client->request('GET', 'http://www.bhg.com/recipe/pork/roasted-pork-with-apples/');
     $scraper = new BHGCom($crawler);
     $scraped = $scraper->scrape();
     $this->assertEquals($recipe, $scraped);
 }
 public function test_scrape_a_recipe_with_ingredient_and_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Kelly Senyei');
     $recipe->setCookTime(new DateInterval('PT8M'));
     $recipe->setDescription('Chicken teriyaki makes a weekly appearance in my home, whether it\'s via the slow cooker, in the form of meatballs or as the stellar sauce atop crispy baked chicken wings. And with the perfect homemade teriyaki sauce in tote, it\'s time to wave goodbye to that bottled stuff and say hello to my go-to tips for successful teriyaki chicken stir-fry.');
     $recipe->setImage('http://www.justataste.com/wp-content/uploads/2016/03/teiryaki-chicken-stir-fry-noodles-recipe.jpg');
     $recipe->setName('Teriyaki Chicken Stir-Fry with Noodles');
     $recipe->setPrepTime(new DateInterval('PT20M'));
     $recipe->setRecipeCategories(['Entrées', 'Healthy', 'Recipes']);
     $recipe->setRecipeIngredients([['title' => 'For The Teriyaki Sauce', 'data' => ['1/2 cup low sodium soy sauce', '1/3 cup low sodium chicken stock', '1/4 cup pineapple juice', '1/4 cup packed light brown sugar', '2 cloves garlic, minced', '1 teaspoon minced fresh ginger', '2 1/2 teaspoons cornstarch']], ['title' => 'For The Stir-fry', 'data' => ['2 Tablespoons vegetable oil, divided', '2 cups broccoli florets', '1 cup sliced red peppers', '1 1/2 cups shredded carrots', '2 large boneless, skinless chicken breasts, cut into thin strips', '8 ounces udon or rice noodles, cooked']]]);
     $recipe->setRecipeInstructions([['title' => 'Make The Teriyaki Sauce', 'data' => ['Whisk together all of the teriyaki sauce ingredients in a medium bowl. Set the sauce aside.']], ['title' => 'Make The Stir-fry', 'data' => ['Add 1 tablespoon vegetable oil to a wok or large, tall-sided sauté pan set over medium-high heat. Add the broccoli, peppers and carrots and cook, stirring constantly, for 3 minutes until the vegetables are still crisp but tender. Transfer the vegetables to a bowl.', 'Add the remaining 1 tablespoon vegetable oil to the pan and place it back over medium-high heat. Add the sliced chicken and cook, stirring constantly, for about 3 minutes or until it is no longer pink. Push the chicken to the edges of the pan then add the prepared teriyaki sauce to the center of the pan. Bring the sauce to a boil and cook it until until it thickens to the consistency of syrup, about 3 minutes.', 'Reduce the heat to low then return the cooked vegetables to the pan and add the cooked noodles, tossing to combine. Serve the stir-fry immediately.']]]);
     $recipe->setRecipeYield('4');
     $recipe->setUrl('http://www.justataste.com/teriyaki-chicken-stir-fry-noodles-recipe/');
     $crawler = $this->client->request('GET', 'http://www.justataste.com/teriyaki-chicken-stir-fry-noodles-recipe/');
     $scraper = new JustATasteCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_a_recipe_with_ingredient_and_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Bobby Flay');
     $recipe->setCookTime(new DateInterval('PT25M'));
     $recipe->setImage('http://foodnetwork.sndimg.com/content/dam/images/food/fullset/2008/6/20/0/GrilledCornCob.jpg.rend.sni12col.landscape.jpeg');
     $recipe->setName('Perfectly Grilled Corn on the Cob');
     $recipe->setPrepTime(new DateInterval('PT1H10M'));
     $recipe->setRecipeCategories(['Corn', 'Side Dish', 'Grilling']);
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['8 ears corn', 'Kosher salt', 'BBQ Butter, recipe follows', 'Herb Butter, recipe follows']], ['title' => 'Bbq Butter', 'data' => ['2 tablespoons canola oil', '1/2 small red onion, chopped', '2 cloves garlic, chopped', '2 teaspoons Spanish paprika', '1/2 teaspoon cayenne powder', '1 teaspoon toasted cumin seeds', '1 tablespoon ancho chili powder', '1/2 cup water', '1 1/2 sticks unsalted butter, slightly softened', '1 teaspoon Worcestershire sauce', 'Salt and freshly ground black pepper']], ['title' => 'Herb Butter', 'data' => ['2 sticks unsalted butter, at room temperature', '1/4 cup chopped fresh herbs (basil, chives or tarragon)', '1 teaspoon kosher salt', 'Freshly ground black pepper']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Heat the grill to medium.', 'Pull the outer husks down the ear to the base. Strip away the silk from each ear of corn by hand. Fold husks back into place, and place the ears of corn in a large bowl of cold water with 1 tablespoon of salt for 10 minutes.', 'Remove corn from water and shake off excess. Place the corn on the grill, close the cover and grill for 15 to 20 minutes, turning every 5 minutes, or until kernels are tender when pierced with a paring knife. Remove the husks and eat on the cob or remove the kernels. Serve with the BBQ Butter and/or Herb Butter. Spread over the corn while hot.']], ['title' => 'Bbq Butter', 'data' => ['Heat the oil in a medium saute pan over high heat until almost smoking. Add the onion and cook until soft, 2 to 3 minutes. Add the garlic and cook for 30 seconds. Add the paprika, cayenne, cumin and ancho powder and cook for 1 minute. Add 1/2 cup of water and cook until the mixture becomes thickened and the water reduces. Let cool slightly.', 'Place the butter in a food processor, add the spice mixture and Worcestershire sauce and process until smooth. Season with salt and pepper, scrape the mixture into a small bowl, cover and refrigerate for at least 30 minutes to allow the flavors to meld. Bring to room temperature before serving.']], ['title' => 'Herb Butter', 'data' => ['Combine in a food processor and process until smooth.']]]);
     $recipe->setRecipeYield('4 to 6');
     $recipe->setTotalTime(new DateInterval('PT1H35M'));
     $recipe->setUrl('http://www.foodnetwork.com/recipes/bobby-flay/perfectly-grilled-corn-on-the-cob-recipe.html');
     $crawler = $this->client->request('GET', 'http://www.foodnetwork.com/recipes/bobby-flay/perfectly-grilled-corn-on-the-cob-recipe.html');
     $scraper = new FoodNetworkCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }