Faker Stripe is a supplier for FakerPHP that generates faux however structurally appropriate IDs for Stripe API assets. Stripe has fairly just a few completely different useful resource sorts, however this package deal has properly over 50+ completely different faker strategies:
$faker->stripeCorePaymentIntentId();
// pi_KiAjc3WFzvswIhq8IkCLXNBW
$faker->stripeConnectAccountId();
// acct_xBXg7yyrSyQVbsjM
$faker->stripeFinancialConnectionAccountId();
// fca_z3JzQ1OCkYved5uWOqh3b387
This package deal simply integrates with PestPHP, PHPUnit, and Eloquent: Factories:
// Pest instance
beforeEach(perform () {
$this->faux = faux();
$this->faux->addProvider(new Stripe($this->faux));
});
it('reveals an instance', perform () {
$this->faux->stripeConnectAccountId() // acct_xBXg7yyrSyQVbsjM
});
// Laravel manufacturing unit instance
use WithFaker;
public perform definition(): array
{
$this->faker->addProvider(new Stripe($this->faker));
$this->faker->stripeConnectAccountId(); // acct_xBXg7yyrSyQVbsjM
}
You’ll be able to be taught extra about this package deal, get full set up directions, and examine the supply code on GitHub.