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