コード例 #1
0
 /**
  *  Loads the Possion Distrubution builder
  *
  *  @access public
  */
 public function poissonDistribution()
 {
     $field = new PoissonDistributionDefinition();
     $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;
 }
コード例 #2
0
 public function testPoissonCreate()
 {
     $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 PoissonDistributionDefinition();
     $dist->database($database);
     $dist->eventDispatcher($event);
     $dist->locale($locale);
     $dist->templateLoader($tempate);
     $dist->utilities($utilities);
     $dist->generator($generator);
     $dist->lambda(0.5);
     $node = $dist->getNode();
     $this->assertInstanceOf('Faker\\Components\\Engine\\Common\\Distribution\\PoissonDistribution', $node);
 }