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

assertGeneratorLocaleIsNot() private method

private assertGeneratorLocaleIsNot ( string $locale, Generator $generator )
$locale string
$generator Faker\Generator
    private function assertGeneratorLocaleIsNot(string $locale, FakerGenerator $generator)
    {
        try {
            $this->assertGeneratorLocaleIs($locale, $generator);
            return;
        } catch (\Exception $exception) {
            if ($exception->getMessage() === sprintf('Generator has not been initialised with the locale "%s".', $locale)) {
                return;
            }
            throw $exception;
        }
        throw new \Exception(sprintf('Generator has been initialised with the locale "%s".', $locale));
    }