Ooni’s Koda 16 pizza oven is the rare kitchen gadget that delivers on its promise

Ooni’s Koda 16 pizza oven is the rare kitchen gadget that delivers on its promise

https://ift.tt/2VHP3pV

Ooni (nee Uuni), has been around for a few years now, but its latest oven, the Koda 16, launched in March. Just like everyone else, I’ve been cooped up at home for weeks with nothing but all of the projects I would get around to one day.

At the top of my list was learning how to make decent pizza at home (we don’t have many decent pizzaiolo’s in my town). I’d been hearing about the Ooni oven for a while — mostly via Neven Mrgan’s great Instagram feed — so I spring for the Koda 13” and started firing some pies.

I was immediately enamored with the eye popping results. Chewy, crispy, well cooked Neopolitain-style pizza within 30 minutes of taking it out of the box. And I’m not exaggerating. After a couple of pizza launching disasters (this is not as easy as it looks, people), I was eating the product of my own hands and the Ooni’s 800+ degree baking surface. While not even an advanced amateur chef, I have always had somewhat of an aversion to single-use gadgets. Technique always wins, right?

The problem with that thinking is that it is really impossible to cook true Neopolitain pizza at home in the US because our ovens just don’t get hot enough. A ton of experimental dough situations have resulted in a few workable New York style pizza recipes for 500 degree ovens. But for thinner crusts there is zero substitute for that true 800-1000 degree cooking environment.

The Ooni delivers that in under 20 minutes attached to a bog standard propane tank. It’s brilliant.

Ooni co-founder Kristian Tapaninaho started messing around with building a decent pizza oven in 2010. He got into making home pies and realized that there was pretty much no way to do it other than building a large, expensive oven in his back yard. He began prototyping what became the company’s original oven in 2012, and he says that the original oven’s design stemmed from a super simple yet super obvious (in hindsight) design constraint: what could they ship affordably?

Due to shipping restrictions, it had to be under 10kg and had to fit in a certain footprint. Everything piece of design work on the first oven stemmed from those constraints. Why, for instance, does the Ooni oven have 3 legs? Because the 4th one would have put them over weight.

Within those constraints, the original oven took shape — delivering that super high-heat surface with a simple wood-fired unit that more than doubled its original funding goal on Kickstarter. Kristian and co-founder Darina Garland defined this high-heat, high results at-home outdoor pizza oven market at scale, along with other later entrants like Roccbox.

I had a bit of a chat with Kristian about how Ooni was doing lately, with the specter of coronavirus and the new business realities that have resulted.

“This COVID-19 situation began for us in mid January as our suppliers started informing us that they were delaying return to work from Chinese New Year,” Kristian said. “At the time the worry was if we’d have enough supply for the summer which is of course peak season for us. As our supply chain was restarting, it was clear that we’d have similar lockdowns in our main markets as well. Overall, however, we started the year at a strong inventory position which helped buffer any interruptions.”

He says that Ooni was lucky given that the initial production run of the Ooni 16 was already in warehouses by the time things got really hairy in Edinburgh and the surrounding areas. And the team was fairly ready for the new challenge of stay-at-home work.

“Much of our team comms already happened over Slack so the team’s been really quite well setup for working from home,” he told me. “We have great relationships with our 3rd party logistics providers and while they’ve been incredibly busy, they’ve been able to maintain a good level of service, at least in the grand scheme of things.”

Yeah, but how does it work?

Once Kristian saw that I was playing with my Ooni 13 he offered to send the newly launched 16″ model over to play with. I jumped at the chance to make a bigger pie.

My experiences with the Ooni ovens so far have been nothing short of revelatory. Though I’ve pondered indoor options like the Breville Smart Oven, I knew in my heart that I wanted that brilliant taste that comes from live fire and the high heat that would let me enjoy super thin crust pizzas. I’ve now fired over three dozen pizzas in the Ooni and am coming to know it a bit better. Its recovery time, rotation needs and cooking characteristics. I have never used a more enjoyable cooking utensil.

I’ve tried a few dough recipes, because I know I’ll get questions about it, but I’ve used two to good effect. Ooni’s own recommended dough (though I hydrate a bit more) and this Peter Reinhart recipe, recommended to me by Richie Nakano.

The pizzas that result are bursting with umami. The oven enables that potent combination of cheese, sauce and randomly distributed carbonization that combines into the perfect bite. Your pie goes in somewhat pedestrian — whitish dough, red sauce, hunks of fresh mozzarella — and you see it come to life right in front of your eyes.  Within 60-90 seconds, you’ve transmogrified the simple ingredients into a hot endocrine rush of savory, chewy flavor.

As I mentioned before, the setup is insanely simple. Flip out the legs, put it on an outdoor surface with some support and attach a propane tank. An instant of lighting knob work and you’re free to step away. Fifteen minutes later and you’ve got a cooking environment to die for. The flip down legs make the 13” model super great for taking camping or anywhere you want to go to create your own pizza party. Ooni even sells a carrying case.

The design of the oven’s upper shell means that all of the heat is redirected inwards, letting the baking surface reach 850 degrees easily in the center, up to 1000 degrees near the back. The Koda 16 has such an incredibly roomy cooking surface that it is easy to see to the sides and around your pizza a bit to tell how the crust is rising and how the leoparding is coming along. Spinning your pie mid-cook is such an important part of this kind of oven and the bigger mouth is smashing for this.

Heck I even cooked steak in it, to mouth watering results.

“Our core message has always been ‘great restaurant quality pizza at home’ and while the situation is what it is, more people spending more time at home looking for great home cooking options has been strong for our online sales,” Kristian said when I asked him about whether more people were discovering Ooni now. “Pizza making is a great way to have fun family time together. It’s about those shared experiences that bring people together.”

This mirrors my experiences so far. I’m not precisely ‘good’ at this yet, but I’m plugging away and the Ooni makes even my misses delicious. This weekend I was even confident enough to hold a socially distanced pizza pick-up party. Friends and family put in their orders and I fired a dozen pies of all kinds. Though I couldn’t hug them, I could safely hand them a freshly fired pizza and to most Italians like me, that’s probably better.

In my mind, the Ooni Koda pulls off a rare trifecta of kitchen gadgets: It retains the joy and energy of live flame, delivers completely on its core premise and still remains incredibly easy to use. Highly recommend.

 

technology

via TechCrunch https://techcrunch.com

April 14, 2020 at 09:30PM

Select Nintendo Labo kits are $20 today at Best Buy

Select Nintendo Labo kits are $20 today at Best Buy

https://ift.tt/3chwDmf

If you’re a parent and want to give your kids something creative to do the next time they play with their Switch, Best Buy is holding a well-timed sale on Nintendo Labo kits. The retailer has discounted all four Labo kits it stocks to $20. At the moment, the Variety and Vehicle kits are the best value since they’re usually $70 and they allow you to build a good selection of projects. With the Variety kit, for instance, you can make a house, piano, motorbike, fishing rod and two RC cars.

Nintendo Labo Variety Kit $20 Nintendo Labo Vehicle Kit $20

Just note that the kits are on sale for today only. Best Buy has also marked each of the products for clearance, so supplies may be limited.

Engadget Senior Editor Devindra Hardawar loved the concept of Labo when he reviewed the Variety and Robot kits in 2018. While he found some of the games you could play with your cardboard creations simplistic, he enjoyed the variety of the experiences each one offered. Building each of the projects was also a lot of fun. We were less fond of the VR kit that Nintendo released last year. While the headset itself was comfortable and studier than Nintendo’s past Labo releases, the lack of a head strap was annoying. We also didn’t find the VR updates to games like Super Mario Odyssey and The Legend of Zelda: Breath of the Wild compelling. At $20, however, all the kits are easier to recommend, especially at a time like this.

geeky,Tech,Database

via Engadget http://www.engadget.com

April 14, 2020 at 10:54AM

Episode 910 Scott Adams: Have You Been Brainwashed by the Government? Find Out Today!

Episode 910 Scott Adams: Have You Been Brainwashed by the Government? Find Out Today!

https://ift.tt/3eeMrbv


My new book LOSERTHINK, available now on Amazon https://tinyurl.com/rqmjc2a

Content:

  • Did Boris Johnson get treated with hydroxychloroquine?
  • Brainwashed children and reflex thinking as adults
  • Shifting risk to people willing to voluntarily accept that risk
  • Sweden’s non-mitigating policy

If you would like my channel to have a wider audience and higher production quality, please donate via my startup (Whenhub.com) at this link: 

I use donations to pay for the daily conversions of the original Periscope videos into Youtube and podcast form, and to improve my production quality and search results over time. 

The post Episode 910 Scott Adams: Have You Been Brainwashed by the Government? Find Out Today! appeared first on Scott Adams’ Blog.

thinkers

via Scott Adams’ Blog https://ift.tt/2ke54Vz

April 13, 2020 at 12:09PM

Polymer80 GLOCK Build Project: Make Your Own 9mm Ghost Gun

Polymer80 GLOCK Build Project: Make Your Own 9mm Ghost Gun

https://ift.tt/3b9PeAQ

Welcome to part one of a three-part series, a joint collaboration between The Truth About Guns, Ammoland, and USA Carry. We’ve started a new project that will include three articles going over the process of building your own Polymer80 GLOCK compatible 9mm pistol and getting it running.

The Polymer80 kit for this project was provided by 80-Lower.com. They sent me one of their complete GLOCK compatible pistol kits. This kit includes the Polymer80 80% frame as well as the lower parts kit, the slide and slide kit, and a small travel safe.

What is an 80% Frame?

Polymer 80 GLOCK compatible build project

The beginnings of a spooky “ghost gun” (Travis Pike for TTAG).

If a gun’s frame or receiver is built, but remains unfinished, it’s not considered a gun…legally speaking. These unfinished frames and receivers are known as “80%” frames or lower receivers (in the case of an AR-15). The idea is that the buyer will do the last 20% of the finish work to make it operate, in effect building his own gun.

That’s something that’s been legal in the U.S. since forever, though now a few states prohibit home builds or require a home-built firearm to be registered and serialized. Be sure you know your state’s laws.

There’s a wide variety of 80% frame and receivers available today, including kits available for AR-15s, AKs, Ruger 10/22s, Sten guns, GLOCKs, and many, many more.

Again, since these are unfinished frames in the eyes of the ATF, the are not considered firearms. That means they can be shipped directly to your home. You don’t have to pay a transfer fee or fill out a 4473 background check form.

Federally it’s perfectly legal to build a gun for your own personal use. As mentioned above, however, that freedom varies among the states, with the demonization of home-builds as “ghost guns.”

A few states have regulated 80% builds, so be sure to check your state’s laws. The only other caveat is that our glorious Federal government says I can’t make these and sell them to anyone else. That requires a manufacturer’s license, but that’s another argument for another day.

The Polymer80 GLOCK frames are known by their official nomenclature as the PF940 series. They come in full-sized, compact, and subcompact models, as well as a G43 variant.

I went with the PF940C, the GLOCK 19/23-sized variant of these frames for this project. They also come in a rather wide variety of colors including black, FDE, OD Green, Cobalt, Titanium, and Gray.

Why Build Your Own?

Because to hell with gun control. Honestly, if you order a lower or a kit over the internet with a credit card, shipped to your home address, keeping it off the books isn’t guaranteed if someone starts looking hard enough. But building your own firearm this way makes it a bit more difficult to track you than a 4473 form would.

My reason for building one, though, is that I like guns, and I like having projects to work on. I’ve built one of these before and I find it to be fun and interesting. It gives you a very excellent view of how GLOCK pistols work and just how simple they are.

Best of all, at the end of the project, you have yourself a very good 9mm handgun.

The PF940 frames also feature better ergonomics than factory GLOCKs as far as I’m concerned. Especially the models prior to the Gen5 guns. They lack finger grooves, have a more 1911-ish grip angle, and feature a more aggressive undercut in the trigger guard.

There is also a more pronounced beavertail to the rear of the grip. I’ve a frequent victim of GLOCK slide bite, but not with this particular pistol.

The Polumer80 frams also feature a normal Picatinny accessory rail as opposed to GLOCK’s weird proprietary rail. The subcompact models have rails, including the G43 variant (GLOCK doesn’t offer that).

If you don’t go the kit route, there’s also the attraction of buying your parts one piece at a time and getting the exact components you want. I can certainly see why it’s easier to do get the parts you want up front and have it done rather than swapping out parts.

What You’ll Need to Finish the Kit

polymer80 pistol build tools you'll need

You don’t need any fancy tools to complete the build (Travis Pike for TTAG)

The Polymer80 kits come with a simple clamp-on jig, as well as the two bits and the endmill you’ll need to finish the pistol. In terms of tools, you can finish the frames a variety of ways.

A guy on Reddit did one with no power tools at all. I used a Dremel, a hand drill, a mallet, and a few punches, tools most people will have or can pick up very affordably. I also used a vise, but in my last build, I didn’t need one. A vise does make things much simpler, though, so if you have one, I recommend you use it.

Polumer80 80% pistol build project

Polymer80 jig with pistol frame inside (Travis Pike for TTAG)

The vise makes the process nearly idiot-proof, although, as we’ll see in this series, I’m a bit of an idiot. Once the jig is snapped over the frame, everything you need to do is aligned and ready to mill. There are no adjustments needed, and it’s all Dremel and drill work after that.

What’s in My Kit?

My complete pistol kit is pretty simple. I used a PF940C frame with a 9mm slide kit produced by 80-Lower. It’s a simple slide with forward and rear serrations and is all black.

I like that, for the most part, the kit is all GLOCK OEM parts. Nothing against the aftermarket, but the Polymer80 PF940C kit was built for GLOCK parts, so that’s the route I wanted to take. It may not be fancy or “custom,” but it will be reliable.

The barrel and trigger assembly that’s included with the 80-lower.com kit (Travis Pike for TTAG)

So that’s the lowdown on 80% frames, why you’d want one and what a kit gun like mine includes in the next sections, we’ll go through building the gun and then making it reliable.

 

 

guns

via The Truth About Guns https://ift.tt/1TozHfp

April 12, 2020 at 04:00PM

How Peeps Are Made

How Peeps Are Made

https://ift.tt/3b3JOXH

How Peeps Are Made

Link

Easter just isn’t Easter without some Peeps. Take a 360º video tour of the Just Born candy factory with Food Network to see how these colorful marshmallow treats are born, including a part of the assembly line called the “Sugar Shower.” Did she really use the word “peepsinality” or were we just hearing things?

fun

via The Awesomer https://theawesomer.com

April 12, 2020 at 01:01PM

These Hilarious Star Trek Videos Turn Bloopers Into Canon

These Hilarious Star Trek Videos Turn Bloopers Into Canon

https://ift.tt/2wAyweM

Worf and Riker.
Image: CBS

Boy, there sure was a lot more high-fiving on the Enterprise than I remember.

Star Trek: The Next Generation was, for all its goofiness, played relatively straight. It was a serious sort of show, even if absurd things sometimes happened. It did not, as a rule, have a lot of gags. Star Trek INtakes by YouTuber Ryan’s Edits changes that, and in the process renders Star Trek’s vibe absolutely absurd. The idea, so far as I can tell, is a simple one: edit outtakes together with the actual episode footage.

This simple idea has incredible results, as normal Star Trek moments turn absurd, surreal, and incredibly funny. I laughed harder at these videos than I have at just about anything lately. There are a handful in a playlist on the Ryan’s Edits channel. The most recent one, featuring Worf and Riker, is one of the best.

The video is titled “Something’s Wrong With Worf”, but, really, it’s Riker I’m most concerned about here. Where’s he going? Is somebody going to stop him? All the videos have this quality, creating a sort of silly alternate universe, entirely chaotic version of the show. I don’t really think CBS should do an absurd art-house comedy version of Star Trek, but, based on this, I’m pretty confident that if they did I would watch it.


For more, make sure you’re following us on our Instagram @io9dotcom.

geeky,Tech

via Gizmodo https://gizmodo.com

April 11, 2020 at 06:12PM

Smith & Wesson M&P 22 Compact: 15,000 Rounds Later

Smith & Wesson M&P 22 Compact: 15,000 Rounds Later

https://ift.tt/2yaj5dt

Smith & Wesson M&P 22 Compact

Smith & Wesson M&P 22 Compact: 15,000 Rounds Later

Five years ago I decided to purchase what would be my first true silencer host.  I decided to take a friend’s advice and start small with a dedicated rimfire silencer, ultimately choosing the budget-friendly SilencerCo Warlock II.  While the Warlock was in NFA jail, I was scouring the internet for a 22 pistol that could reliably run any standard velocity ammo I could find.  After a lot of searching, I finally settled on the Smith & Wesson M&P 22 Compact.

The Right Tools

Smith & Wesson M&P 22 Compact

M&P 22 Compact Silencer and Tools

Over the years I’ve found that it’s all about having the right tools to routinely disassemble the M&P 22 Compact.  Rather than highlight the pistol’s features I’ve put together a quick how-to guide for servicing the M&P like a pro.

SilencerCo Adapter Removal

M&P 22 Compact Adapter Wrench

To attach a silencer you’ll need to remove the factory barrel nut and purchase a thread adapter.  This particular adapter is a Delta series that I purchased from SilencerCo.  More importantly, you’re gonna need a wrench, and I mean like a REAL wrench.

Smith & Wesson M&P 22 Compact

M&P 22 Compact Takedown Adapter Removal

EWK Arms makes a wrench out of bar stock specifically for the factory barrel nut on the M&P 22.  If you want to suppress this little pistol, it’s absolutely worth the $30.

Smith & Wesson M&P 22 Compact

M&P 22 Compact Takedown Removing Slide

With the adapter removed, and takedown lever pushed down, you simply slide the slide rearward and up to remove it from the frame.

Smith & Wesson M&P 22 Compact

M&P 22 Compact Disassembled

As you can see this little M&P is pretty filthy, and only gets cleaned roughly every 1,500 rounds.  Pretty impressive when you consider that the only stoppages it’s recently had were failures to lock the slide open on an empty mag.

The Silencer

SilencerCo Warlock II

SilencerCo Warlock II Front Cap Removal

Next up is the Warlock II, which is incredibly light and easy to take apart for service.  Using the takedown tool supplied, you simply insert it into the grooves on the front cap, and twist counter-clockwise.

SilencerCo Warlock II

SilencerCo Warlock II End Cap Removal

From there you flip the tube over and use the large end of the takedown tool to remove the mount.

SilencerCo Warlock II

SilencerCo Warlock II Takedown

The Warlock II uses a Click Together Assembly (CTA) to connect the baffle stack.  The CTA stack does a great job of keeping carbon trapped in the baffles so baffles fall freely out of the tube when disassembled.

Takeaways

Hindsight is always 20/20, and if I could go back in time I would’ve opted to spend the extra money and buy the heavier Stainless Steel SilencerCo Spectre.  I’m not discounting how awesome the 3oz Warlock II is, but for a heavy use its aluminum baffles are difficult to clean.

Smith & Wesson M&P 22 Compact

M&P 22 Compact Slide Release Wear

As for the M&P, it just keeps on running.  To this day the only real wear I’ve noticed on the gun has been on the slide release.  Occasionally it’ll fail to hold the slide back on the last round, but this hasn’t been enough of an annoyance for me to want to fix it.  The gun just works and shows no signs of stopping.

The Verdict

Smith & Wesson M&P 22 Compact

Smith & Wesson M&P 22 Compact and SilencerCo Warlock II

I can’t say enough nice things about the M&P 22 Compact.  Its short barrel means that standard velocity ammo is rendered subsonic, and the gun is just an all-around blast to shoot.  I started keeping track of how many rounds I shot through this gun just so I could remember to clean the silencer.  Undoubtedly if I hadn’t, the Warlock would surely be fused together by carbon and lead at this point.

If you’re in the market for a 22 pistol that isn’t picky about ammo, is easy to clean, and performs well suppressed, you absolutely need to look at the M&P 22 compact.

Would I buy it again?  Absolutely, and there isn’t another 22 pistol I’d rather own.

Note:  At the time of this article, the M&P 22 Compact has 15,220 rounds through it.



We are committed to finding, researching, and recommending the best products. We earn commissions from purchases you make using the retail links in our product reviews.

Learn more about how this works

.

guns

via The Firearm Blog https://ift.tt/2JX8W99

April 10, 2020 at 02:05PM

Airplane Recycling Company Employee Has to Activate Detached Emergency Slide, to the Amusement of Co-Workers

Airplane Recycling Company Employee Has to Activate Detached Emergency Slide, to the Amusement of Co-Workers

https://ift.tt/3c8zLkp

Whatever group of people engineered self-inflating airplane emergency slides deserve many awards. It’s absurd to see something that big emerge from something that small in such a short amount of time:

As for how and why this guy is tasked with doing this in a driveway: The video is from a Dutch company called Aircraft End-of-Life Solutions, who recorded it in December of a previous year. As the name suggests, AELS dismantles and recycles decommissioned airplanes, and blowing the slide was part of their "End of the year clean up."

fun

via Core77 https://ift.tt/1KCdCI5

April 10, 2020 at 08:30AM

Laravel 7 auth scaffolding step by step

Laravel 7 auth scaffolding step by step

https://youtu.be/v4ePoIp8Or0


In this video, I have shown you how to make Laravel 7 auth scaffolding from scratch. With this video tutorial, you will learn a step by step process for making authentication & registration system for Laravel 7. To read text tutorial & code for this video please visit http://bit.ly/laravel7-auth Laravel 7 authentication Laravel 7 registration system Laravel 7 make:auth Laravel 7 login registration tutorial Social Links ——————- https://www.youtube.com/LaravelArticle https://ift.tt/2y4ytbz https://twitter.com/laravelarticle ⚠️ DISCLAIMER Do not download or copy from this channel. It’s a cybercrime. All video of this channel are copyright to laravelarticle.com

programming

via Laravel News Links https://ift.tt/2dvygAJ

April 10, 2020 at 09:03AM

Testing Cashier

Testing Cashier

https://ift.tt/2JCqHIa

Testing Cashier

Published on April 4, 2020

One of the most asked questions I get about Cashier is how you start testing your billing integration of your app. So let’s check out a couple of ways how you’d tackle that.

Stripe API

The best way to test Cashier and your billing integration is to actually hit the Stripe API. Doing so will give you the confidence that your billing integration is actually working as expected. In fact, we added a section to the docs yesterday that details just that.

To get started, add the testing version of your Stripe secret to your phpunit.xml file:

<env name="STRIPE_SECRET" value="sk_test_<your-key>"/>

Now, whenever you interact with Cashier while testing, it will send actual API requests to your Stripe testing environment. For convenience, you should pre-fill your Stripe testing account with subscriptions / plans that you may then use during testing.

Hitting the Stripe API will cause your tests to run slowly but usually you wouldn’t be running these tests very often, maybe just right before you do a deploy. Therefore it’s best to separate these tests into a separate directory in your test suite.

In order to test different kinds of scenarios in your test suite you can make use of a vast range of Stripe testing tokens.

If you want to look at an example of doing these kind of tests, have a look at Cashier’s own test suite.

stripe-mock

Stripe is currently developing a library called “stripe-mock” which will allow to mock these expensive HTTP calls when testing. Unfortunately, the library currently is stateless and Cashier relies on persisted state in Stripe a lot. When this library eventually implements persistence, we’ll update Cashier’s own test suite and update these docs so you can make use of it.

Hiding Behind An Interface

A second option is to hide Cashier calls behind an interface. In fact, in one app I took this approach and it worked very well. The apps’ tests ran very fast. Let’s see how we’d tackle this.

We’ll start off by defining an interface for our subscriptions:

<?php namespace App\Billing\Subscriptions; use App\User; use Laravel\Cashier\Subscription; interface SubscriptionRepository { public function subscribe(User $customer, string $plan, string $paymentMethod): Subscription; }

Then implement the actual Stripe calls which we’ll use in our app:

<?php namespace App\Billing\Subscriptions; use App\User; use Laravel\Cashier\Subscription; final class StripeSubscriptionRepository implements SubscriptionRepository { public function subscribe(User $customer, string $plan, string $paymentMethod): Subscription { return $customer->newSubscription('main', $plan)->create($paymentMethod); } }

And the TestSubscriptionRepository which contains our testing implementation:

<?php namespace App\Billing\Subscriptions; use App\User; use Illuminate\Support\Str; use Laravel\Cashier\Subscription; final class TestingSubscriptionRepository implements SubscriptionRepository { public function subscribe(User $customer, string $plan, string $paymentMethod): Subscription { return $customer->subscriptions()->create([ 'name' => 'main', 'stripe_id' => Str::random(), 'stripe_status' => 'active', 'stripe_plan' => $plan, 'quantity' => 1, ]); } }

After this you can register the implementations in the register method of your AppServiceProvider:

$this->app->singleton(SubscriptionRepository::class, function ($app) { if ($app->environment('testing')) { return new TestingSubscriptionRepository; } return new StripeSubscriptionRepository; });

And now your Stripe calls will be replaced during your tests and they’ll run much faster.

There are a couple of downsides to this approach. First of all, you’re trading part of the confidence you get when actually hitting the Stripe API. The other downside is that you’ll have to partially re-implement Cashier’s behavior. And depending on how much functionality you use from Cashier that could potentially be a lot. Of course, you’d only replace the parts which make Stripe calls.

Mocking

The third one is an obvious one when unit testing. You could use a library like Mockery to mock those expensive API calls. Let’s see how that works.

Imagine we have the following job:

<?php namespace App\Jobs; use App\User; final class SubscribeCustomer { private User $customer; private string $plan; private string $paymentMethod; public function __construct(User $customer, string $plan, string $paymentMethod) { $this->customer = $customer; $this->plan = $plan; $this->paymentMethod = $paymentMethod; } public function handle(): void { $this->customer->newSubscription('main', $this->plan) ->create($this->paymentMethod); } } 

We could write the following test where we mock the actual Cashier calls:

<?php namespace Tests\Unit\Jobs; use App\User; use App\Jobs\SubscribeCustomer; use Illuminate\Foundation\Testing\RefreshDatabase; use Laravel\Cashier\SubscriptionBuilder; use Mockery; use PHPUnit\Framework\TestCase; class SubscribeCustomerTest extends TestCase { public function tearDown(): void { parent::tearDown(); Mockery::close(); } /** @test */ public function it_can_process_a_new_subscription() { $subscriptionBuilder = Mockery::mock(SubscriptionBuilder::class); $subscriptionBuilder->shouldReceive('create') ->with('foo-method'); $customer = Mockery::mock(User::class); $customer->expects('newSubscription') ->with('main', 'plan-1') ->andReturn($subscriptionBuilder); (new SubscribeCustomer($customer, 'plan-1', 'foo-method'))->handle(); } }

And thus no Stripe API calls are made. Of course this only mocks the calls but doesn’t re-implements the behavior like our interface example. The above technique is ideal for unit tests but not so much for feature tests.

Conclusion

We’ve seen three different techniques when it comes to testing Cashier and while each one holds a benefit and a downside I’d still recommend making actual Stripe HTTP calls if you want to be entirely sure your billing integration works as expected. If stripe-mock ever gets persistency we can solve the speed issue that way. But definitely don’t be afraid to use the other two techniques. Use what works best for your situation.

programming

via Laravel News Links https://ift.tt/2dvygAJ

April 10, 2020 at 09:03AM