コード例 #1
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);
     }
 }
コード例 #2
0
 /**
  * @covers \CSanquer\FakeryGenerator\Config\FakerConfig::getMethods
  * @dataProvider providerGetMethods
  */
 public function testGetMethods($locale, $provider, $expected)
 {
     $this->assertSame($expected, $this->config->getMethods($locale, $provider));
 }