PHP code example of jonpurvis / faker-stripe

1. Go to this page and download the library: Download jonpurvis/faker-stripe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jonpurvis / faker-stripe example snippets


it('generates a well structured stripe account id', function () {
   fake()->addProvider(new Stripe(fake()));
   
   expect(fake()->stripeConnectAccountId())->toStartWith('acct_')->toHaveLength(21)->toBeString();
});

public function testGeneratesWellStructuredStripeAccountId()
{
    $faker = Factory::create();
    $faker->addProvider(new Stripe($faker));

    $this->assertStringStartsWith('acct_', $faker->stripeConnectAccountId());
}

use WithFaker;

public function definition(): array
{
    $this->faker->addProvider(new Stripe($this->faker));
    
    return [
        'id' => $this->faker->stripeConnectAccountId(),
        'name' => 'John Doe',
        'email' => '[email protected]'
    ];   
}