Exemplo n.º 1
0
 /**
  * Read the row pattern to determine which columns are dynamic, set the collection size
  *
  * @param array $rowPattern
  * @param int $limit how many records to generate
  */
 public function __construct(array $rowPattern, $limit)
 {
     foreach ($rowPattern as $key => $value) {
         if (is_callable($value) || is_string($value) && false !== strpos($value, '%s')) {
             $this->_dynamicColumns[$key] = $value;
         }
     }
     $this->_pattern = $rowPattern;
     $this->_limit = (int) $limit;
     parent::__construct(array_keys($rowPattern));
 }
Exemplo n.º 2
0
 /**
  * Rewind the Iterator to the first element (Iterator interface)
  */
 public function rewind()
 {
     rewind($this->_file);
     $this->_getNextRow();
     // skip first line with the header
     parent::rewind();
 }
Exemplo n.º 3
0
 /**
  * @expectedException OutOfBoundsException
  */
 public function testSeekableInterfaceException()
 {
     $this->_model->seek(0);
 }