Пример #1
0
 /**
  *  Fetch the node managed by this definition
  *
  *  @access public
  *  @return Faker\Components\Engine\Common\Composite\CompositeInterface the new node
  */
 public function getNode()
 {
     if ($this->dataIterator === null && !empty($this->dataClosure)) {
         $this->dataIterator = $this->dataClosure->__invoke();
     }
     $source = new PHPDatasource();
     $source->setIterator($this->dataIterator);
     return $source;
 }
Пример #2
0
 /**
  * @expectedException Faker\Components\Engine\EngineException
  * @expectedExceptionMessage PHPDatasource must have some data assigned
  */
 public function testDatasourceValidateFailsEmptyData()
 {
     $mock = new PHPDatasource();
     $mock->setOption('name', 'unique_source_1');
     $mock->validate();
 }