Nelmio\Alice\Faker\GeneratorFactoryTest::testAssertGeneratorLocaleMethod PHP Method

testAssertGeneratorLocaleMethod() public method

    public function testAssertGeneratorLocaleMethod()
    {
        $this->assertGeneratorLocaleIs('en_US', FakerFactory::create());
        try {
            $this->assertGeneratorLocaleIs('fr_FR', FakerFactory::create());
            $this->fail('Expected exception to be thrown.');
        } catch (\Exception $exception) {
            $this->assertEquals('Generator has not been initialised with the locale "fr_FR".', $exception->getMessage());
        }
        $this->assertGeneratorLocaleIs('fr_FR', FakerFactory::create('fr_FR'));
    }