public function test_parse_a_recipe_with_undetectable_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setCookTime(new DateInterval('PT2H'));
     $recipe->setImage('http://pioneerwoman.files.wordpress.com/2014/06/14456033103_d701528868_z.jpg?w=630&h=419');
     $recipe->setName('Blackberry Cheesecake Squares');
     $recipe->setPrepTime(new DateInterval('PT4H'));
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['Crust', '10 ounces, weight (2 Sleeves) Graham Crackers', '1/2 cup Pecans Or Walnuts', '1/2 cup Butter, Melted', '1 teaspoon Vanilla Extract', 'Filling', '3 packages (8 Ounces Each) Cream Cheese, Softened', '1-1/2 cup Sugar', '1-1/2 teaspoon Vanilla Extract', '4 whole Eggs', '1/2 cup Sour Cream', 'Topping', '4 cups Blackberries', '1 cup Sugar', '1/4 cup Water', '2 Tablespoons Cornstarch', '4 Tablespoons Water']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Preheat the oven to 350 degrees. Place a 9 x 13 inch pan (or other ovenproof pan) of hot water into the bottom rack.', 'For the crust, line a separate 9 x 13 inch baking pan with foil. Spray with cooking spray. Add the graham crackers and pecans to the bowl of a food processor. Pulse them until they\'re fine crumbs. Drizzle in melted butter, pulsing until it\'s all incorporated. Pulse in the vanilla. Pour the crumbs into the prepared pan and press the crumbs firmly into an even layer. Set aside.', 'Beat cream cheese, sugar, and vanilla together until smooth. Add eggs one at a time, beating after each addition. Add sour cream and beat until incorporated.', 'Pour the filling into the crust and smooth the surface. Bake for 45 minutes, then turn off the oven and leave the door closed for an additional 10 minutes. Finally, open the door halfway and leave it in the oven for an additional 10 minutes. Remove the cheesecake and let it cool completely.', 'For the topping, add blackberries, sugar, and 1/4 cup water to a saucepan. Bring it to a boil and cook until the juices thicken slightly, about 4-5 minutes. In a small bowl, mix the cornstarch with 4 tablespoons water to make a slurry, then add it to the berries. Let it boil for another 1 to 2 minutes, then turn off the heat and allow to cool.', 'Pour the blackberries over the cheesecake and place the pan into the fridge to chill and set for at least 2 hours. When ready to serve, remove the cheesecake from the pan by lifting the edges of the foil. Peel back the foil and use a long serrated knife to cut cheesecake into squares.']]]);
     $recipe->setRecipeYield('16');
     $recipe->setUrl('http://thepioneerwoman.com/cooking/blackberry-cheesecake-squares/');
     $crawler = $this->client->request('GET', 'http://thepioneerwoman.com/cooking/blackberry-cheesecake-squares/');
     $scraper = new ThePioneerWomanCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_recipe_with_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setCookTime(new DateInterval('PT50M'));
     $recipe->setDescription('A sweet and delicious baked french toast casserole with a praline topping.');
     $recipe->setImage('http://static.pauladeen.com/media/catalog/product/cache/1/small_image/9df78eab33525d08d6e5fb8d27136e95/b/a/baked_french_toast_casserole_1.jpg');
     $recipe->setName('Baked French Toast Casserole');
     $recipe->setPrepTime(new DateInterval('PT10M'));
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['dash salt', '1 teaspoon ground nutmeg, divided', '1 teaspoon ground cinnamon, divided', '1 tablespoon vanilla extract', '2 tablespoons sugar', '1 cup milk', '8 large eggs', '2 cups half and half', '1 loaf French bread, (13 to 16 oz)', '1/2 lb butter, plus more for pan', '1 cup light brown sugar, packed', '1 cup chopped pecans', '2 tablespoons light corn syrup', '1 cup raspberry preserves', '3 tablespoons water', '2 tablespoons raspberry liqueur']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Slice French bread into 20 slices, 1-inch thick each. (Use any extra bread for garlic toast or bread crumbs). Arrange slices in a generously buttered 9X13 casserole dish in 2 rows, overlapping the slices.', 'In a large bowl, combine the eggs, half and half, milk, sugar, vanilla, 1/2 teaspoon cinnamon, 1/2 teaspoon nutmeg and salt and beat with a rotary beater or whisk until blended but not too bubbly. Pour mixture over the bread slices, making sure all are covered evenly with the milk-egg mixture. Spoon some of the mixture in between the slices. Cover with foil and refrigerate overnight.', 'The next day, preheat oven to 350 °. Spread Praline Topping evenly over the bread and bake for 45 minutes, until puffed and lightly golden. Serve with Raspberry Syrup.']], ['title' => 'Praline Topping', 'data' => ['Combine butter, brown sugar, pecans, light corn syrup, 1/2 teaspoon cinnamon and 1/2 teaspoon nutmeg in a medium bowl and blend well. Spread over bread as directed above.']], ['title' => 'Raspberry Syrup', 'data' => ['Combine raspberry preserves, water and liqueur in a small saucepan and place over medium heat. Stir until warm and thinned out like syrup.']]]);
     $recipe->setTotalTime(new DateInterval('PT60M'));
     $recipe->setUrl('http://www.pauladeen.com/baked-french-toast-casserole/');
     $crawler = $this->client->request('GET', 'http://www.pauladeen.com/baked-french-toast-casserole/');
     $scraper = new PaulaDeenCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setCookTime(new DateInterval('PT30M'));
     $recipe->setImage('http://cdn1.tmbi.com/TOH/Images/Photos/37/300x300/exps37457_THCA1693311D146.jpg');
     $recipe->setName('Chocolate Mallow Cake Recipe');
     $recipe->setPrepTime(new DateInterval('PT60M'));
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['1/3 cup shortening', '1 cup sugar', '1/2 cup packed brown sugar', '2 large eggs', '2 ounces unsweetened chocolate, melted and cooled', '1 teaspoon vanilla extract', '1 cup buttermilk', '1/4 cup water', '1-3/4 cups cake flour', '1-1/2 teaspoons baking soda', '3/4 teaspoon salt']], ['title' => 'Filling', 'data' => ['1 cup packed brown sugar', '3 tablespoons all-purpose flour', '1 cup milk', '2 large egg yolks, beaten', '2 tablespoons butter', '1 teaspoon vanilla extract', '1/2 cup chopped pecans']], ['title' => 'Frosting', 'data' => ['1-1/2 cups sugar', '2 large egg whites', '1/3 cup water', '1 tablespoon light corn syrup', '1/4 teaspoon cream of tartar', '2 cups miniature marshmallows', '1 ounce unsweetened chocolate, melted']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['In a large bowl, cream shortening and sugars. Add eggs, one at a time, beating well after each. Beat in chocolate and vanilla. Combine buttermilk and water. Combine the cake flour, baking soda and salt; add to creamed mixture alternately with buttermilk mixture.', 'Pour into a greased and floured 13-in. x 9-in. baking pan. Bake at 350 ° for 30-35 minutes or until a toothpick inserted near the center comes out clean. Cool for 10 minutes before removing from pan to a wire rack.', 'For filling, in a small saucepan, combine brown sugar and all-purpose flour. Stir in milk until smooth. Cook and stir over medium-high heat until thickened and bubbly. Reduce heat; cook and stir 2 minutes longer. Remove from the heat. Stir a small amount of hot filling into egg yolks; return all to pan, stirring constantly. Bring to a gentle boil; cook and stir 2 minutes longer.', 'Remove from the heat. Gently stir in butter and vanilla. Cool to room temperature without stirring. Spread over cake to within 1/2 in. of edges; sprinkle with pecans. Refrigerate for 30 minutes or until set.', 'For frosting, in a heavy saucepan over low heat, combine the sugar, egg whites, water, corn syrup and cream of tartar. With a portable mixer, beat on low speed for 1 minute. Continue beating on low over low heat for 8-10 minutes or until frosting reaches 160 °.', 'Pour into the large bowl of a heavy-duty stand mixer; add marshmallows. Beat on high for 7-9 minutes or until stiff peaks form. Carefully spread over cake. Pipe thin lines of melted chocolate over cake; gently pull a toothpick or sharp knife through lines in alternating directions. Store in the refrigerator.']]]);
     $recipe->setRecipeYield('15');
     $recipe->setTotalTime(new DateInterval('PT90M'));
     $recipe->setUrl('http://www.tasteofhome.com/recipes/chocolate-mallow-cake');
     $crawler = $this->client->request('GET', 'http://www.tasteofhome.com/recipes/chocolate-mallow-cake');
     $scraper = new TasteOfHomeCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setCookTime(new DateInterval('PT35M'));
     $recipe->setImage('http://cook.sndimg.com/content/dam/images/cook/fullset/2012/8/20/0/CCUQS206_Peanut-Butter-Pie-Fudge_s4x3.jpg/jcr:content/renditions/cq5dam.web.266.200.jpeg');
     $recipe->setName('Peanut Butter Pie Fudge');
     $recipe->setPrepTime(new DateInterval('PT45M'));
     $recipe->setRecipeIngredients([['title' => 'Pie Crust', 'data' => ['20 cream-filled chocolate sandwich cookies', '1 tablespoon butter, melted']], ['title' => 'Peanut Butter Fudge', 'data' => ['1 1/2 cups confectioners\' sugar', '1/2 stick butter', '1 cup brown sugar', '1/2 cup whipping cream (30-percent fat)', '1/2 teaspoon salt', '1/2 cup peanut butter', '1/2 teaspoon vanilla extract']], ['title' => 'Caramel', 'data' => ['1/2 cup heavy cream (36-to38-percent fat)', '1/2 cup brown sugar', '1/2 cup granulated sugar', '1/4 cup corn syrup', '1/4 cup whipping cream (30-percent fat)', '1/2 stick butter', '1/2 teaspoon salt', '1/2 teaspoon vanilla extract']], ['title' => 'Marshmallows', 'data' => ['1/3 pound large marshmallows']], ['title' => 'Chocolate Fudge', 'data' => ['1 1/2 cups confectioners\' sugar', '2 tablespoons butter', '1 1/2 cups heavy cream (36-to38-percent fat)', '1/2 cup brown sugar', '1/2 teaspoon salt', '4 ounces unsweetened chocolate', '1/2 teaspoon vanilla extract']], ['title' => 'English Toffee', 'data' => ['1/4 cup English toffee pieces']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['For the crust: Preheat the oven to 340 degrees F. Break up the cookies into small pieces and press into a 9-by-9-inch baking pan. Brush with melted butter. Bake for 11 minutes. For the peanut butter fudge: Put the confectioners\' sugar in a large mixing bowl and set aside. Melt the butter in a small saucepan over medium heat. Stir in the brown sugar, whipping cream and salt. Bring to a boil. Boil for 2 minutes and remove from the heat. Stir in the peanut butter and vanilla. Pour the mixture over the confectioners\' sugar and mix. Spoon the mixture into the cookie pie crust until it is completely covered. For the caramel: In a small saucepan, combine the heavy cream, brown sugar, granulated sugar, corn syrup, whipping cream, butter and salt. Heat over low heat until the butter is completely melted. Gradually increase the heat to medium-high and bring the mixture to a boil, stirring frequently. Reduce the heat to medium and continue to boil, while stirring, until the temperature on a candy thermometer reads 250 degrees F. Remove from the heat, stir in the vanilla and pour over the peanut butter fudge. (You can double the recipe for this layer and pour half of the caramel into a buttered dish to cut up and enjoy as caramel candies.) For the marshmallows: In a microwave-safe bowl, melt the marshmallows in the microwave for 40 seconds. Working quickly, use a spatula to spread over the caramel layer. If you take too long, the marshmallows will set up and won\'t spread nicely. For the chocolate fudge: Put the confectioners\' sugar in a large mixing bowl and set aside. Melt the butter in a small saucepan over medium heat. Stir in the cream, brown sugar and salt. Bring to a boil. Boil for 2 minutes and remove from the heat. Stir in the chocolate and vanilla until all the chocolate is melted and the mixture is smooth. Pour the mixture over the confectioners\' sugar. Beat with an electric mixer for 3 to 4 minutes until very smooth. Spread evenly over the marshmallow layer with a spatula. For the toffee: Sprinkle the toffee over the top of the chocolate fudge. To serve: You do not have to wait for the fudge to set before serving. Using a metal spatula, cut and serve in cake-like squares. This recipe was provided by a chef, restaurant or culinary professional and may have been scaled down from a bulk recipe. The Food Network Kitchens chefs have not tested this recipe, in the proportions indicated, and therefore, we cannot make any representation as to the results.']]]);
     $recipe->setRecipeYield('16 4-inch squares');
     $recipe->setTotalTime(new DateInterval('PT1H20M'));
     $recipe->setUrl('http://www.cookingchanneltv.com/recipes/peanut-butter-pie-fudge.html');
     $crawler = $this->client->request('GET', 'http://www.cookingchanneltv.com/recipes/peanut-butter-pie-fudge.html');
     $scraper = new CookingChannelTVCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_recipe_with_ingredient_and_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('eMeals');
     $recipe->setCookTime(new DateInterval('PT30M'));
     $recipe->setImage('http://i2.wp.com/spryliving.com/wp-content/uploads/2016/04/caprese.png?resize=670%2C405');
     $recipe->setName('Baked Caprese Chicken with Lemon Green Beans and Parmesan Polenta');
     $recipe->setPrepTime(new DateInterval('PT15M'));
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['1 1/2 pounds boneless, skinless chicken breasts', '1/2 teaspoon salt', '1/2 teaspoon pepper', '3 large Roma tomatoes, sliced', '1 (1-oz) pkg fresh basil, thinly sliced (or use leaves whole)', '1 (8-oz) ball fresh mozzarella cheese, thinly sliced (or use block mozzarella)', '2 tablespoons olive oil', '3 tablespoons balsamic vinegar']], ['title' => 'Lemon Green Beans And Parmesan Polenta', 'data' => ['3/4 cup uncooked polenta', '1/2 teaspoon salt, divided', '1/2 teaspoon pepper, divided', '1/4 cup freshly grated Parmesan cheese', '2 pounds fresh green beans, trimmed', '1 tablespoon olive oil', '1 tablespoon fresh lemon juice']]]);
     $recipe->setRecipeInstructions([['title' => 'For The Chicken', 'data' => ['Preheat oven to 350 °F. Place chicken in a 13- x 9-inch baking dish coated with cooking spray; sprinkle with salt and pepper.', 'Top with tomatoes, basil, and mozzarella; drizzle with olive oil.', 'Bake 30 minutes or until chicken is done; drizzle with vinegar before serving.']], ['title' => 'For The Green Beans', 'data' => ['Bring 3 cups water to a boil in a large saucepan; whisk in polenta and 1/4 tsp each salt and pepper. Return to a boil, reduce heat, and simmer until liquid is absorbed, stirring occasionally. Stir in cheese.', 'Arrange green beans in a steamer basket over boiling water. Cover and steam 5 minutes or until crisp-tender.', 'Drain and transfer to a serving bowl. Drizzle with olive oil and lemon juice; sprinkle with remaining 1/4 tsp each salt and pepper.']]]);
     $recipe->setRecipeYield('6');
     $recipe->setUrl('http://spryliving.com/recipes/baked-caprese-chicken/');
     $crawler = $this->client->request('GET', 'http://spryliving.com/recipes/baked-caprese-chicken/');
     $scraper = new SpryLivingCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_a_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Candace Braun Davison');
     $recipe->setCookTime(new DateInterval('PT12M'));
     $recipe->setDescription('It\'s a whole new take on the fudgy dessert that set Pinterest on fire.');
     $recipe->setImage('http://del.h-cdn.co/assets/15/46/1447456786-delish-cool-whip-pies-slutty-brownie-recipe.jpg');
     $recipe->setName('Slutty Brownie Pie');
     $recipe->setPrepTime(new DateInterval('PT15M'));
     $recipe->setRecipeIngredients([['title' => 'Chocolate Chip Cookie Crust', 'data' => ['1 tube premade chocolate chip cookie dough']], ['title' => 'Pudding Layer', 'data' => ['2/3 packet instant chocolate pudding mix', '1 1/2 c. milk']], ['title' => 'Chocolate Whipped Cream Layer', 'data' => ['1 container cool whip', '1/3 packet instant chocolate pudding mix', '1/2 c. crumbled brownie pieces', 'chocolate sauce']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['For the crust: Preheat the oven to 350 °F. As it heats, grease the bottom and sides of a 9-inch pie plate. Cover with chocolate chip cookie dough. Bake for 16-18 minutes, and shortly after it\'s out of the oven, use a measuring cup to press down the dough so it forms a gooey crust. Place in the refrigerator to cool.', 'For the pudding layer: Whisk 2/3 packet of pudding mix with milk. Refrigerate five minutes to set, then pour into the cooled cookie crust. Cover the pudding with a layer of Oreo cookies.', 'For the chocolate whipped cream layer: In a separate bowl, mix Cool Whip with remaining 1/3 packet pudding mix. Fold in crumbled brownies, and pour the mixture on top of the pie. Garnish with more brownie pieces. Refrigerate for 4 hours, then drizzle with chocolate sauce just before serving.']]]);
     $recipe->setRecipeYield('8');
     $recipe->setTotalTime(new DateInterval('PT27M'));
     $recipe->setUrl('http://www.delish.com/cooking/recipe-ideas/recipes/a44836/slutty-brownie-pie-recipe-cool-whip-desserts/');
     $crawler = $this->client->request('GET', 'http://www.delish.com/cooking/recipe-ideas/recipes/a44836/slutty-brownie-pie-recipe-cool-whip-desserts/');
     $scraper = new DelishCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_a_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Nestle® Beneful®');
     $recipe->setCookTime(new DateInterval('PT20M'));
     $recipe->setDescription('Apple slices, cider, thyme and mustard bring incredible, rich flavors to this easy chicken dinner. Wild or brown rice makes a perfect side dish.');
     $recipe->setImage('http://images.media-allrecipes.com/userphotos/720x405/2731461.jpg');
     $recipe->setName('Apple Cider Chicken with Wild Rice');
     $recipe->setPrepTime(new DateInterval('PT15M'));
     $recipe->setRecipeIngredients([['title' => 'Chicken', 'data' => ['3 skinless, boneless chicken breast halves, cut in half lengthwise to make thin cutlets', 'salt and ground black pepper to taste', '1 tablespoon canola oil or other neutral-flavor cooking oil', '1/4 cup shallots, minced', '1 tablespoon apple cider vinegar', '2 cups sweet apple cider', '1 tart apple, such as Granny Smith - peeled, cored and thinly sliced', '1 sweet apple, such as Gala or Fuji - peeled, cored and thinly sliced', '1 cup chicken broth', '3 teaspoons cornstarch', '2 tablespoons fresh thyme leaves', '1 teaspoon Dijon mustard', 'salt and pepper to taste']], ['title' => 'Sides', 'data' => ['3 cups cooked wild rice or brown rice, or combination of the two']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Season chicken cutlets with salt and pepper.', 'Get a skillet very hot. Once it is hot, add oil to it and brown the chicken on both sides. Cook for about 5 minutes on each side, until it\'s a nice, golden color. Remove from the pan and set aside on a plate. It\'s okay that it\'s undercooked, it will finished cooking in the sauce.', 'Over high heat, brown the shallots.', 'Add cider vinegar and scrape the bottom of the pan, getting all the shallots and any leftover browned chicken bits.', 'Before the vinegar evaporates, add the cider and the apple slices. Let this reduce on high for about 3 minutes. The apples and shallots will get very tender.', 'While they reduce, mix the chicken broth and the cornstarch until there are no lumps left, then slowly add it to the bubbling cider and apples, stirring all the time while the sauce thickens.', 'Mix in thyme, mustard, salt and pepper.', 'Return the chicken and its juices back into the sauce, turn down to medium-low and summer for at least 10 minutes, or until the chicken is cooked all the way through. Serve with hot cooked rice.']]]);
     $recipe->setRecipeYield('4');
     $recipe->setTotalTime(new DateInterval('PT35M'));
     $recipe->setUrl('http://allrecipes.com/recipe/245148/apple-cider-chicken-with-wild-rice/');
     $crawler = $this->client->request('GET', 'http://allrecipes.com/recipe/245148/apple-cider-chicken-with-wild-rice/');
     $scraper = new AllRecipesCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 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());
 }
示例#10
0
 public function test_scrape_a_standard_recipe()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Better Homes and Gardens');
     $recipe->setCookTime(new DateInterval('PT240M'));
     $recipe->setDescription('For more of the flavor of Germany, heat Bavarian-style sauerkraut to serve along with the well-seasoned pork and tangy gravy.');
     $recipe->setImage('http://images.meredith.com/content/dam/bhg/Images/recipe/38/37352.jpg.rendition.largest.ss.jpg');
     $recipe->setName('Bavarian Pork Roast');
     $recipe->setPrepTime(new DateInterval('PT25M'));
     $recipe->setRecipeCategories(['Dinner Recipes', 'Ethnic Recipes', 'Healthy Dinners', 'Healthy Recipes', 'Heart Healthy Dinners', 'Heart-Healthy Recipes', 'Low Fat Recipes', 'Pork Recipes', 'Quick and Easy Dinners', 'Quick and Easy Healthy Dinner Recipes', 'Slow Cooker Recipes']);
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['1 1 1/2 pound boneless pork shoulder roast', '2 teaspoons caraway seed', '1 teaspoon dried marjoram, crushed', '3/4 teaspoon salt', '1/2 teaspoon pepper', '1 tablespoon olive oil or cooking oil', '1/2 cup water', '2 tablespoons white wine vinegar', '1 ounce carton dairy sour cream or plain yogurt', '4 teaspoons cornstarch']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Trim fat from roast. If necessary, cut roast to fit into a 3-1/2- to 6-quart crockery cooker. Combine caraway seed, marjoram, salt, and pepper. Rub all over roast.', 'In a large skillet, brown pork roast on all sides in hot oil. Drain off fat. Place meat in crockery cooker. Add the water to skillet; bring to a gentle boil over medium heat, stirring to loosen brown bits in bottom of skillet. Pour skillet juices and vinegar into crockery cooker.', 'Cover and cook on low-heat setting for 8 to 10 hours or on high-heat setting for 4 to 5 hours. Remove meat from cooker; keep warm.', 'For gravy, skim fat from juices; measure 1-1/4 cups juices (add water, if necessary). Pour juices into a saucepan; bring to boiling. Combine sour cream or yogurt and cornstarch. Stir into juices. Cook and stir over medium heat until thickened and bubbly. Cook and stir 2 minutes more. Slice meat and serve with gravy. Makes 6 servings.']]]);
     $recipe->setRecipeYield('6');
     $recipe->setUrl('http://www.bhg.com/recipe/meat/bavarian-pork-roast/');
     $crawler = $this->client->request('GET', 'http://www.bhg.com/recipe/meat/bavarian-pork-roast/');
     $scraper = new BHGCom($crawler);
     $scraped = $scraper->scrape();
     $this->assertEquals($recipe, $scraped);
     $this->assertEquals(new DateInterval('PT4H25M'), $scraped->totalTime);
 }