/**
  * @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());
 }
Exemple #2
0
 public function setUp()
 {
     $faker = new Generator();
     $simulator = new Simulator();
     $faker->addProvider(new Quote($faker, $simulator));
     $this->faker = $faker;
     $this->simulator = $simulator;
 }
Exemple #3
0
 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;
 }
Exemple #4
0
 public function setUp()
 {
     $faker = new Generator();
     $faker->addProvider(new Base($faker));
     $this->faker = $faker;
 }