コード例 #1
0
 /**
  * @covers \CSanquer\FakeryGenerator\Config\FakerConfig::getMethod
  * @dataProvider providerGetMethod
  */
 public function testGetMethod($name, $expected)
 {
     $this->assertEquals($expected, $this->config->getMethod($name));
 }
コード例 #2
0
 public function validateMethod(ExecutionContextInterface $context)
 {
     if ($this->fakerConfig && !in_array($this->getMethod(), array_keys($this->fakerConfig->getMethods()))) {
         $context->addViolationAt('method', 'This method \'{{ method }}\' is not available in Faker.', ['{{ method }}' => $this->getMethod()], null);
     }
 }
コード例 #3
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);
     }
 }