コード例 #1
0
 /**
  * @covers \CSanquer\FakeryGenerator\Config\FakerConfig::getLocales
  */
 public function testGetLocales()
 {
     $expected = ['en_US', 'es_ES', 'fr_FR'];
     $this->assertEquals($expected, $this->config->getLocales());
 }
コード例 #2
0
ファイル: Config.php プロジェクト: csanquer/fakery-generator
 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);
     }
 }