/** * Finds the specific files and lines that we determine to be tests * * @param array $options * @return array A multidimensional array. */ public static function findLines($options) { $fileInfo = array(); foreach ($options['paths'] as $path) { foreach ($options['files'] as $name => $prototype) { $files = Files::find('all', array('recursive' => true, 'dir' => $path, 'conditions' => array('name' => $name))); foreach ($files as $file) { $lines = array(); foreach ($file as $key => $line) { if (preg_match($prototype, $line, $matches) === 1) { $lines[] = $key + 1; } } if (!empty($lines)) { $fileInfo[] = array('name' => $file->getPath() . '/' . $file->getFilename(), 'lines' => $lines); } } } } return $fileInfo; }
/** * @covers FileRecord::__call */ public function testSplFileObject() { $file = Files::find('first', array('recursive' => false, 'dir' => $this->base)); $name = $file->getFileName(); $expected = 'mockFile.txt'; $this->assertEqual($expected, $name); }