/** * @test */ public function add_provider_gives_priority_to_newly_added_provider() { $generator = new Generator(); $generator->addProvider(new FooProvider()); $generator->addProvider(new BarProvider()); $this->assertEquals('barfoo', $generator->fooFormatter()); }
public function setUp() { $faker = new Generator(); $simulator = new Simulator(); $faker->addProvider(new Quote($faker, $simulator)); $this->faker = $faker; $this->simulator = $simulator; }
public static function create() { $generator = new Generator(); $simulator = new Simulator(); foreach (static::$defaultProviders as $provider) { $providerClassName = self::getProviderClassname($provider); $generator->addProvider(new $providerClassName($generator, $simulator)); } return $generator; }
public function setUp() { $faker = new Generator(); $faker->addProvider(new Base($faker)); $this->faker = $faker; }