예제 #1
0
 public function testIteratorNegative()
 {
     $directoryPath = 'directory/path';
     $filePath = $this->filePaths[0];
     $this->setExpectedException('UnexpectedValueException', sprintf("Unable to determine a module, file '%s' belongs to.", $filePath));
     $this->directoryMock->expects($this->at(0))->method('getAbsolutePath')->with($filePath)->will($this->returnValue($directoryPath . $filePath));
     $this->moduleDirResolverMock->expects($this->at(0))->method('getModuleName')->with($directoryPath . $filePath)->will($this->returnValue(false));
     $this->directoryMock->expects($this->never())->method('readFile');
     $this->fileIterator->current();
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function current()
 {
     $row = parent::current();
     if ($this->key() === 0 && $this->ignoreFirstLine === true) {
         $this->next();
     }
     if ($this->names) {
         if (count($row) != count($this->names)) {
             return;
         } else {
             $row = array_combine($this->names, $row);
         }
     }
     return $row;
 }