public function getNode() { $type = new AlphaNumeric(); $type->setGenerator($this->generator); $type->setUtilities($this->utilities); $type->setLocale($this->locale); foreach ($this->attributes as $attribute => $value) { $type->setOption($attribute, $value); } return new TypeNode('AlphaNumeric', $this->eventDispatcher, $type); }
/** * @expectedException Faker\Components\Engine\EngineException * @expectedExceptionMessage AlphaNumeric::Repeat range is not valid minimum is > maximum */ public function testConfigExceptionRepeatMinGreaterThanRepeatMax() { $utilities = $this->getMockBuilder('Faker\\Components\\Engine\\Common\\Utilities')->disableOriginalConstructor()->getMock(); $generator = $this->getMock('\\PHPStats\\Generator\\GeneratorInterface'); $locale = $this->getMock('\\Faker\\Locale\\LocaleInterface'); $type = new AlphaNumeric(); $type->setGenerator($generator); $type->setLocale($locale); $type->setUtilities($utilities); $type->setOption('format', 'ccCC'); $type->setOption('repeatMax', 1); $type->setOption('repeatMin', 2); $type->validate(); }