public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Taste of Home\'s Fast Family Favorites');
     $recipe->setDescription('If you like pumpkin, you\'ll love these moist muffins. With an appealing streusel topping and tender apple bits throughout, they make a great accompaniment to a meal or a handy breakfast on the run.');
     $recipe->setImage('http://images.media-allrecipes.com/userphotos/250x250/742085.jpg');
     $recipe->setName('Apple Pumpkin Muffins');
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['2 1/2 cups all-purpose flour', '2 cups sugar', '1 tablespoon pumpkin pie spice', '1 teaspoon baking soda', '1/2 teaspoon salt', '2 eggs', '1 cup canned or cooked pumpkin', '1/2 cup vegetable oil', '2 cups finely chopped peeled apples']], ['title' => 'Streusel', 'data' => ['1/4 cup sugar', '2 tablespoons all-purpose flour', '1/2 teaspoon ground cinnamon', '4 teaspoons cold butter or margarine']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['In a bowl, combine the first five ingredients. In another bowl, combine the eggs, pumpkin and oil; stir into dry ingredients just until moistened. Fold in apples. Fill paper-lined muffin cups two-thirds full. In a small bowl, combine sugar, flour and cinnamon. Cut in butter until crumbly. Sprinkle over batter.', 'Bake at 350 degrees for 35-40 minutes or until golden brown. Cool for 5 minutes before removing from pans to wire racks.']]]);
     $recipe->setRecipeYield('18');
     $recipe->setUrl('http://allrecipes.com/recipe/42273/apple-pumpkin-muffins/');
     $crawler = $this->client->request('GET', 'http://allrecipes.com/recipe/42273/apple-pumpkin-muffins/');
     $scraper = new AllRecipesCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_a_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Hungry Happenings');
     $recipe->setDescription('Want an over-the-top way to make peach cobbler that won’t take you all day to decorate? This four-layer, cinnamon-infused yellow cake topped with cheesecake filling, caramelized peaches and brown sugar cake crumbles couldn’t be more amazing.');
     $recipe->setImage('http://images-gmi-pmc.edge-generalmills.com/0374ccd2-63a9-4380-a86d-0f4acb02d607.jpg');
     $recipe->setName('Naked Peach Cobbler Cake');
     $recipe->setRecipeIngredients([['title' => 'Cake Layers', 'data' => ['1 box Betty Crocker™ SuperMoist™ cake mix yellow', '1 cup water', '1/2 cup oil', '3 large eggs', '1 teaspoon cinnamon']], ['title' => 'Glazed Peaches', 'data' => ['10 tablespoons butter', '1/2 cup brown sugar', '1/2 cup granulated sugar', '10 peaches, peeled and sliced', '1 teaspoon cinnamon', '1/4 teaspoon nutmeg']], ['title' => 'Cheesecake Layers', 'data' => ['2 8-ounce blocks of cream cheese, softened', '1/4 cup granulated sugar', '7 ounces marshmallow fluff', '8 ounces frozen whipped topping, thawed']], ['title' => 'Brown Sugar Cake Crumbles', 'data' => ['1/3 cup brown sugar', '3/4 cup cake crumbs (from cake layers above)', '1/2 teaspoon cinnamon', '2 tablespoons butter, melted']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['CAKE LAYERS: Preheat oven to 350 °F. Spray two 8-inch round cake pans with baking spray, then line bottoms of pans with rounds of parchment paper. Make cake mix according to package instructions. Stir in the cinnamon and equally divide batter between cake pans. Bake for 28-34 minutes until a toothpick inserted in the center comes out clean. Remove from oven and let cool in pan for 10 minutes, then un-mold onto a cooling rack and allow to cool completely.', 'GLAZED PEACHES: Heat butter in a skillet set over medium-high heat. Once melted, stir in both sugars and allow to dissolve. Toss in peach slices, cinnamon and nutmeg. Bring to a boil, then reduce heat to medium-low and cook until peaches are tender, 10-16 minutes. Remove from heat and allow to cool completely.', 'CHEESECAKE FILLING: Beat cream cheese using an electric mixer or food processor until light and fluffy. Add sugar and marshmallow fluff and beat until well incorporated. Beat in whipped topping just until combined.', 'BROWN SUGAR CAKE CRUMBLES: Preheat oven to 350 °F. Cut off the domed portion of each cake and crumble the tops into very small pieces. Measure out 3/4 cup crumbs and mix with brown sugar, cinnamon and melted butter. Spread out into a thin layer on a baking sheet. Bake for 10 minutes, then remove and stir. Bake an additional 6-10 minutes until fragrant and deep golden brown. Remove and allow to cool completely.', 'To assemble cake: Cut each cake into 2 even layers. Set one layer on a cake plate. Spread 1/4th of the cheesecake filling over top. Spoon 1/4 of the glazed peaches on top. Sprinkle on 1/4 of the brown sugar cake crumbles over the peaches. Repeat this process, adding the remaining 3 cake layers and topping them with cheesecake filling, peaches, and cake crumbles. Refrigerate until ready to serve. Will keep in the refrigerator up to 5 days.']]]);
     $recipe->setRecipeYield('12');
     $recipe->setTotalTime(new DateInterval('PT3H'));
     $recipe->setUrl('http://www.tablespoon.com/recipes/naked-peach-cobbler-cake/5155d33e-558b-4414-964c-a23518caded7');
     $crawler = $this->client->request('GET', 'http://www.tablespoon.com/recipes/naked-peach-cobbler-cake/5155d33e-558b-4414-964c-a23518caded7');
     $scraper = new TablespoonCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
 public function test_scrape_another_standard_recipe()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Tiffani Thiessen');
     $recipe->setImage('http://cook.sndimg.com/content/dam/images/cook/fullset/2015/3/6/0/CCTIF110_Plum-Caprese-Salad-recipe_s4x3.jpg/jcr:content/renditions/cq5dam.web.266.200.jpeg');
     $recipe->setName('Plum Caprese Salad');
     $recipe->setPrepTime(new DateInterval('PT10M'));
     $recipe->setRecipeIngredients([['title' => '', 'data' => ['1 tablespoon champagne vinegar', '1 teaspoon white balsamic vinegar', 'Kosher salt and freshly ground black pepper', '3 tablespoons olive oil', '1 1/2 pounds heirloom tomatoes, various colors, cut into wedges', '3 ripe plums, cut into wedges', '8 ounces burrata cheese', '1/4 cup fresh basil leaves, thinly sliced', '10 fresh mint leaves, thinly sliced', 'Sea salt flakes, for garnishing']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Whisk together the champagne vinegar, white balsamic vinegar and a pinch of kosher salt. Stream the olive oil into the vinegar mixture, whisking; set aside. Arrange the tomatoes and plums on a serving platter, alternating the tomatoes and plums. Tear the buratta over the top. Sprinkle the basil and mint over the salad and then drizzle with the vinaigrette. Finish with a pinch of sea salt and some pepper; serve.']]]);
     $recipe->setRecipeYield('6');
     $recipe->setTotalTime(new DateInterval('PT10M'));
     $recipe->setUrl('http://www.cookingchanneltv.com/recipes/tiffani-thiessen/plum-caprese-salad.html');
     $crawler = $this->client->request('GET', 'http://www.cookingchanneltv.com/recipes/tiffani-thiessen/plum-caprese-salad.html');
     $scraper = new CookingChannelTVCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
Ejemplo n.º 4
0
 public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Ann Taylor Pittman');
     $recipe->setDescription('Thawed lemonade concentrate adds bold, fun flavor to this tart layer cake. This cake is the perfect solution to summer birthday parties or winter events when you need to wake up your taste buds.');
     $recipe->setImage('http://cdn-image.myrecipes.com/sites/default/files/styles/300x300/public/image/recipes/ck/02/04/layer-cake-ck-249959-x.jpg?itok=1Ma3bcrJ');
     $recipe->setName('Lemonade Layer Cake');
     $recipe->setPublisher('Cooking Light');
     $recipe->setRecipeIngredients([['title' => 'Cake', 'data' => ['1 1/3 cups granulated sugar', '6 tablespoons butter, softened', '1 tablespoon grated lemon rind', '3 tablespoons thawed lemonade concentrate', '2 teaspoons vanilla extract', '2 large eggs', '2 large egg whites', '2 cups all-purpose flour', '1 teaspoon baking powder', '1/2 teaspoon salt', '1/2 teaspoon baking soda', '1 1/4 cups fat-free buttermilk', 'Cooking spray']], ['title' => 'Frosting', 'data' => ['2 tablespoons butter, softened', '2 teaspoons grated lemon rind', '2 teaspoons thawed lemonade concentrate', '1/2 teaspoon vanilla extract', '8 ounces 1/3-less-fat cream cheese', '3 1/2 cups powdered sugar']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Preheat oven to 350 °.', 'To prepare cake, place first 5 ingredients in a large bowl; beat with a mixer at medium speed until well blended (about 5 minutes). Add eggs and egg whites, 1 at a time, beating well after each addition. Lightly spoon flour into dry measuring cups; level with a knife. Combine flour, baking powder, salt, and baking soda; stir well with a whisk. Add flour mixture and buttermilk alternately to sugar mixture, beginning and ending with flour mixture; beat well after each addition.', 'Pour batter into 2 (9-inch) round cake pans coated with cooking spray; sharply tap pans once on counter to remove air bubbles. Bake at 350 ° for 20 minutes or until wooden pick inserted in center comes out clean. Cool in pans 10 minutes on a wire rack; remove from pans. Cool completely on wire rack.', 'To prepare frosting, place 2 tablespoons butter and the next 4 ingredients (2 tablespoons butter through cream cheese) in a large bowl; beat with a mixer at high speed until fluffy. Add powdered sugar, and beat at low speed just until blended (do not overbeat). Chill 1 hour.', 'Place 1 cake layer on a plate; spread with 1/2 cup frosting. Top with remaining cake layer. Spread remaining frosting over top and sides of cake. Store cake loosely covered in the refrigerator.']]]);
     $recipe->setRecipeYield('16');
     $recipe->setUrl('http://www.myrecipes.com/recipe/lemonade-layer-cake');
     $crawler = $this->client->request('GET', 'http://www.myrecipes.com/recipe/lemonade-layer-cake');
     $scraper = new MyRecipesCom($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_and_instruction_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Katherine Sacks');
     $recipe->setDescription('This version of our delicious vanilla-buttermilk cake is simply topped with a swoosh of orange cream-cheese frosting and raspberries. It\'s so easy to serve right out of the pan, which makes it perfect for backyard barbecues and potlucks.');
     $recipe->setImage('http://assets.epicurious.com/photos/57719d947823d8090d928cd9/master/pass/Vanilla-Buttermilk-Cake-Raspberries-27062016.jpg');
     $recipe->setName('Vanilla-Buttermilk Sheet Cake With Raspberries and Orange Cream-Cheese Frosting');
     $recipe->setPublisher('Epicurious');
     $recipe->setRecipeCategories(['Cake', 'Birthday', 'Raspberry', 'Orange', 'Cream Cheese', 'Vanilla', 'Dessert', 'Summer', 'Potluck', 'Buttermilk']);
     $recipe->setRecipeIngredients([['title' => 'For The Buttermilk Cake', 'data' => ['2 cups cake flour, plus more for pan', '1 teaspoon baking powder', '1/2 teaspoon baking soda', '1/4 teaspoon kosher salt', '3/4 cup (1 1/2 sticks) unsalted butter, room temperature', '1 3/4 cups granulated sugar, divided', '4 large eggs, separated', '1 teaspoon vanilla extract', '1 cup buttermilk']], ['title' => 'For The Vanilla Syrup', 'data' => ['1/4 cup granulated sugar', '1 vanilla bean, split lengthwise']], ['title' => 'For The Orange Cream-cheese Frosting', 'data' => ['1 (8-ounce) package cream cheese, chilled', '5 tablespoons unsalted butter, room temperature', '1/2 teaspoon finely grated orange zest', '1 1/2 teaspoons fresh orange juice', '1/2 teaspoon vanilla extract', '6 Tbsp. powdered sugar, sifted']], ['title' => 'For The Assembly', 'data' => ['4 ounces raspberries', 'Edible flowers (for garnish; optional)']]]);
     $recipe->setRecipeInstructions([['title' => 'Bake The Buttermilk Cake', 'data' => ['Place a rack in middle of oven; preheat to 350 °F. Flour a 13x9" pan, tapping out excess. Whisk baking powder, baking soda, salt, and remaining 2 cups flour in a medium bowl; set aside.', 'Using an electric mixer on medium-high speed, beat butter and 1 1/2 cups granulated sugar in a large bowl, scraping down sides of bowl as needed, until light and creamy, about 5 minutes. Add egg yolks in 2 additions, scraping down bowl after each. Beat in vanilla.', 'Reduce mixer speed to low, then add dry ingredients in 2 additions alternately with buttermilk in 2 additions, scraping down sides of bowl as needed.', 'Using electric mixer on medium speed, beat egg whites in another large bowl until soft peaks form, 2 –3 minutes. Slowly add remaining 1/4 cup granulated sugar and continue to beat until stiff, glossy peaks form, about 3 minutes more. Fold half of the egg whites into flour mixture, then gently fold in remaining egg whites.', 'Scrape batter into prepared pan; smooth surface. Bake, rotating pan halfway through and covering with foil during the last 15 minutes of baking, until golden brown, firm to the touch, and a tester inserted into the center comes out clean, 35 –40 minutes. Transfer pan to a wire rack and let cake cool.']], ['title' => 'Make The Vanilla Syrup', 'data' => ['Combine granulated sugar and 1/4 cup water in a medium saucepan. Scrape in vanilla seeds, add pod, and stir to combine. Bring to a boil, cover, and steep at least 15 minutes. Set aside to cool. Discard pod before using.']], ['title' => 'Make The Orange Cream-cheese Frosting', 'data' => ['Using electric mixer on medium-high speed, beat cream cheese and butter in a large bowl until smooth, about 1 minute. Beat in orange zest, orange juice, and vanilla. Reduce mixer speed to low and beat in powdered sugar, scraping down bowl as needed, until light and fluffy, 2 –3 minutes.']], ['title' => 'Assemble The Cake', 'data' => ['Using a pastry brush, brush top of cooled cake with 2 Tbsp. vanilla syrup; reserve remaining syrup for another use. Spread frosting over top of cake, swirling decoratively. Top with raspberries and edible flowers, if using.']], ['title' => 'Do Ahead', 'data' => ['Cake can be made 3 days ahead; wrap tightly in plastic and chill, or freeze up to 2 weeks. Syrup can be made 5 days ahead; store in an airtight container and chill. Frosting can be made 3 days ahead; cover with plastic wrap, pressing directly on surface, and chill. Bring to room temperature before using.']]]);
     $recipe->setRecipeYield('1 (13x9") cake');
     $recipe->setUrl('http://www.epicurious.com/recipes/food/views/vanilla-buttermilk-sheet-cake-with-raspberries-and-orange-cream-cheese-frosting');
     $crawler = $this->client->request('GET', 'http://www.epicurious.com/recipes/food/views/vanilla-buttermilk-sheet-cake-with-raspberries-and-orange-cream-cheese-frosting');
     $scraper = new EpicuriousCom($crawler);
     $this->assertEquals($recipe, $scraper->scrape());
 }
Ejemplo n.º 7
0
 public function test_scrape_another_recipe_with_ingredient_groups()
 {
     $recipe = new Recipe();
     $recipe->setAuthor('Lauren Salkeld');
     $recipe->setDescription('With a fudgy brownie bottom and rich layer of pumpkin cheesecake, these bars are on the must-make list for fall.');
     $recipe->setImage('http://del.h-cdn.co/assets/15/43/1600x800/landscape-1445292205-pumpkin-cheesecake-bars-1.jpg');
     $recipe->setName('Pumpkin Cheesecake Brownie Bars');
     $recipe->setPrepTime(new DateInterval('PT30M'));
     $recipe->setRecipeIngredients([['title' => 'For The Brownies', 'data' => ['1 c. (2 sticks) unsalted butter', '8 oz. semisweet chocolate, coarsely chopped', '2 c. sugar', '4 large eggs', '1 tbsp. pure vanilla extract', '1 1/4 c. all-purpose flour', '1 tsp. baking powder', '1/2 tsp. kosher salt', '1/2 c. chocolate chips']], ['title' => 'For The Cheesecake', 'data' => ['2 8-ounce packages cream cheese, at room temperature', '3/4 c. sugar', '1 1/2 tsp. pumpkin pie spice', '1/8 tsp. kosher salt', '2 tsp. pure vanilla extract', '1 c. canned pumpkin', '1/4 c. heavy cream', '1/4 c. sour cream']]]);
     $recipe->setRecipeInstructions([['title' => '', 'data' => ['Make the brownies: Butter a 9-x-13" baking pan and line with parchment paper, leaving a 2" overhang on all sides. Butter the parchment. Set a rack in the middle of the oven and preheat to 350 degrees F.', 'In a bowl set over a pan of barely simmering water, melt chocolate and butter, stirring until smooth. Set aside to cool.', 'In a medium bowl, whisk together sugar, eggs, and vanilla. In a second medium bowl, whisk together flour, baking powder, and salt. Add sugar mixture to melted chocolate and whisk to combine. Add flour mixture and chocolate chips and gently fold until just combined and streak free.', 'Pour brownie batter into prepared baking pan and smooth top. Bake until just set, 12 to 15 minutes. Let cool on a wire rack. Reduce oven temperature to 325 degrees F.', 'Make the cheesecake: In the bowl of a stand mixer fitted with the paddle attachment (or a large bowl with a hand mixer), beat cream cheese on medium speed, scraping down bowl as necessary, until completely smooth, 3 to 4 minutes. Add pumpkin pie spice and salt and beat, scraping down bowl as necessary, until smooth and fluffy, 3 to 4 minutes. Add vanilla and beat 30 seconds. Add eggs one at a time, beating 1 minute after each addition and scraping down bowl as necessary. Add pumpkin, heavy cream, and sour cream and beat on low until completely smooth and streak-free, about 1 minute.', 'Pour cheesecake batter over cooled brownies and smooth top. Bake until set around the edges and just barely jiggling in the center, 45 minutes. Let cheesecake cool to room temperature on a wire rack. Once completely cool, loosely cover cheesecake with plastic wrap and chill in the refrigerator at least 3 hours, but preferably overnight.']]]);
     $recipe->setRecipeYield('24 bars');
     $recipe->setTotalTime(new DateInterval('PT6H15M'));
     $recipe->setUrl('http://www.delish.com/cooking/recipe-ideas/recipes/a44395/pumpkin-cheesecake-brownie-bars-recipe/');
     $crawler = $this->client->request('GET', 'http://www.delish.com/cooking/recipe-ideas/recipes/a44395/pumpkin-cheesecake-brownie-bars-recipe/');
     $scraper = new DelishCom($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());
 }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
0
 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());
 }