/** * @covers \CSanquer\FakeryGenerator\Config\FakerConfig::getLocales */ public function testGetLocales() { $expected = ['en_US', 'es_ES', 'fr_FR']; $this->assertEquals($expected, $this->config->getLocales()); }
public function validateLocale(ExecutionContextInterface $context) { if ($this->fakerConfig && !in_array($this->getLocale(), $this->fakerConfig->getLocales())) { $context->addViolationAt('locale', 'This locale \'{{ locale }}\' is not available in Faker.', ['{{ locale }}' => $this->getLocale()], null); } }