public function validate() { $rowsToGenerate = $this->getRowsToGenerate(); if (is_integer($rowsToGenerate) === false) { throw new CompositeException($this, 'rows to generate must be an integer'); } if ($rowsToGenerate <= 0) { throw new CompositeException($this, 'rows to generate must be > 0'); } parent::validate(); }
/** * @expectedException Faker\Components\Engine\Common\Composite\CompositeException * @expectedExceptionMessage Table must have a name */ public function testValidateFailsWithEmptyId() { $utilities = $this->getMockBuilder('Faker\\Components\\Engine\\Common\\Utilities')->getMock(); $generator = $this->getMock('\\PHPStats\\Generator\\GeneratorInterface'); $locale = $this->getMock('\\Faker\\Locale\\LocaleInterface'); $event = $this->getMockBuilder('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface')->getMock(); $parent = $this->getMockBuilder('Faker\\Components\\Engine\\Common\\Composite\\CompositeInterface')->getMock(); $id = null; $type = new TableNode($id, $event); $type->setParent($parent); $type->validate(); }