コード例 #1
0
 public function testCreateType()
 {
     $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();
     $type = new NumericTypeDefinition();
     $type->eventDispatcher($event);
     $type->database($database);
     $type->locale($locale);
     $type->utilities($utilities);
     $type->generator($generator);
     $typeNode = $type->getNode();
     $interalType = $typeNode->getType();
     $this->assertInstanceOf('Faker\\Components\\Engine\\Common\\Type\\Numeric', $interalType);
     $this->assertInstanceOf('\\Faker\\Components\\Engine\\Common\\Composite\\TypeNode', $typeNode);
 }