Exemplo n.º 1
0
 public function normalDistribution()
 {
     $field = new NormalDistributionDefinition();
     $field->generator($this->generator);
     $field->utilities($this->utilities);
     $field->database($this->database);
     $field->locale($this->locale);
     $field->eventDispatcher($this->eventDispatcher);
     $field->templateLoader($this->templateLoader);
     return $field;
 }
Exemplo n.º 2
0
 public function testNormalCreate()
 {
     $utilities = $this->getMockBuilder('Faker\\Components\\Engine\\Common\\Utilities')->disableOriginalConstructor()->getMock();
     $generator = $this->getMock('\\PHPStats\\Generator\\GeneratorInterface');
     $locale = $this->getMock('\\Faker\\Locale\\LocaleInterface');
     $event = $this->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->getMock();
     $database = $this->getMockBuilder('Doctrine\\DBAL\\Connection')->disableOriginalConstructor()->getMock();
     $tempate = $this->getMockBuilder('Faker\\Components\\Templating\\Loader')->disableOriginalConstructor()->getMock();
     $dist = new NormalDistributionDefinition();
     $dist->database($database);
     $dist->eventDispatcher($event);
     $dist->locale($locale);
     $dist->templateLoader($tempate);
     $dist->utilities($utilities);
     $dist->generator($generator);
     $dist->mu(0.5);
     $dist->variance(0.5);
     $node = $dist->getNode();
     $this->assertInstanceOf('Faker\\Components\\Engine\\Common\\Distribution\\NormalDistribution', $node);
 }