public function getUntouchedFiles(&$untouched, $touched, $parentPath, $rootPath, $directoryDepth = 1) { $parent = opendir($parentPath); while ($file = readdir($parent)) { $path = "{$parentPath}/{$file}"; if (is_dir($path)) { if ($file != '.' && $file != '..') { if ($this->isDirectoryIncluded($path, $directoryDepth)) { $this->getUntouchedFiles($untouched, $touched, $path, $rootPath, $directoryDepth + 1); } } } elseif ($this->isFileIncluded($path)) { $relativePath = CoverageDataHandler::ltrim($rootPath . '/', $path); if (!array_key_exists($relativePath, $touched)) { $untouched[] = $relativePath; } } } closedir($parent); }
function testLtrim() { $this->assertEqual('ber', CoverageDataHandler::ltrim('goo', 'goober')); $this->assertEqual('some/file', CoverageDataHandler::ltrim('./', './some/file')); $this->assertEqual('/x/y/z/a/b/c', CoverageDataHandler::ltrim('/a/b/', '/x/y/z/a/b/c')); }
function writeUntouchedFile($file) { $relativeFile = CoverageDataHandler::ltrim('./', $file); $sql = "insert into untouched values ('{$relativeFile}')"; $this->db->queryExec($sql); }
public function writeUntouchedFile($file) { $relativeFile = CoverageDataHandler::ltrim('./', $file); $sql = "INSERT INTO untouched VALUES ('{$relativeFile}')"; $this->db->exec($sql); }