Lines Matching refs:this
25 $this->view = $view;
26 $view->setController($this);
27 $this->rooturl = $rooturl;
35 $this->sqlite = new \Sqlite3($_POST['setdatabase']);
37 return $this->view->TOC($this->sqlite);
40 return $this->getDatabase();
42 $this->sqlite = new \Sqlite3($_POST['setdatabase']);
45 return $this->view->testTOC($this->sqlite);
48 return $this->view->fileCoverage($this->sqlite, $_GET['file'], $_GET['test']);
50 return $this->view->testTOC($this->sqlite, $_GET['test']);
54 return $this->view->fileLineTOC($this->sqlite, $_GET['file'], $_GET['line']);
56 return $this->view->fileCoverage($this->sqlite, $_GET['file']);
58 return $this->view->TOC($this->sqlite);
65 return $this->rooturl . '?file=' . urlencode($file) . '&line=' . $line;
68 return $this->rooturl . '?file=' . urlencode($file) . '&test=' . $test;
70 return $this->rooturl . '?file=' . urlencode($file);
76 return $this->rooturl;
79 return $this->rooturl . '?test=TOC';
82 return $this->rooturl . '?test=' . urlencode($test);
88 $this->sqlite = $this->view->getDatabase();
122 $output->writeAttribute('action', $this->controller->getTOCLink());
138 $this->controller = $controller;
144 $this->renderSummary($sqlite, $sqlite->retrievePaths(), false, $coverage[1], $covered[0]);
149 $this->renderTestSummary($sqlite);
164 return $this->controller->getFileLink($path, $istest);
169 return $this->controller->getTOClink($path);
174 return $this->controller->getFileLink($name, null, $line);
180 if (!$output->openUri($this->getLinePath($name, $line))) {
204 $output->writeAttribute('href', $this->mangleFile($name));
212 $output->writeAttribute('href', $this->mangleTestFile($testfile));
229 if (!$output->openUri($this->manglePath($source->name(), $istest))) {
289 $output->writeAttribute('href', $this->getLineLink($source->name(), $num));
294 $this->renderLineSummary($source->name(), $num, $source->testpath(),
354 $output->writeAttribute('href', $this->controller->getTOCLink(true));
360 $source = new SourceFile($name, $agg, $this->testPath, $this->sourcePath);
374 $output->writeAttribute('href', $this->mangleFile($name, $istest));
405 $output->writeAttribute('href', $this->controller->getTOClink());
413 $output->writeAttribute('href', $this->mangleTestFile($test));
448 $this->render($source, $reltest);
462 $output->writeAttribute('href', $this->mangleFile($name, $reltest));
503 $this->sqlite = new Sqlite($codepath, $db);
504 $this->codepath = $codepath;
509 return $this->sqlite->retrieveLineLinks($file);
514 return $this->sqlite->retrievePaths();
519 return $this->sqlite->retrievePathsForTest($test);
524 return $this->sqlite->retrieveTestPaths();
529 return $this->sqlite->coveragePercentage($sourcefile, $testfile);
534 return $this->sqlite->retrievePathCoverage($path);
539 return $this->sqlite->retrievePathCoverageByTest($path, $test);
544 return $this->sqlite->retrieveCoverage($path);
549 return $this->sqlite->retrieveCoverageByTest($path, $test);
556 $this->sqlite->addCoverage(str_replace('.xdebug', '.phpt', $path), $testid, $xdebug);
567 $this->testpath = $testpath;
596 if ($this->sqlite->unChangedXdebug($path)) {
608 foreach ($this->sqlite->retrieveTestPaths() as $path) {
615 $this->sqlite->removeOldTest($path, $xdebugpath);
622 $decorator = new DefaultSourceDecorator($toPath, $this->testpath, $this->codepath);
624 $coverage = $this->sqlite->retrieveProjectCoverage();
626 … $decorator->renderSummary($this, $this->retrievePaths(), $this->codepath, false, $coverage[1],
628 $a = $this->codepath;
630 $decorator->renderTestCoverage($this, $this->testpath, $a);
655 $this->source = file($path);
656 $this->path = $path;
657 $this->sourcepath = $sourcepath;
659 array_unshift($this->source, '');
660 unset($this->source[0]); // make source array indexed by line number
662 $this->aggregator = $agg;
663 $this->testpath = $testpath;
664 $this->setCoverage();
669 $this->coverage = $this->aggregator->retrieveCoverage($this->path);
674 return $this->aggregator;
679 return $this->testpath;
687 return $decorator->render($this);
692 if (!isset($this->coverage[$line])) {
695 return $this->coverage[$line];
700 return $this->aggregator->coveragePercentage($this->path);
705 return $this->path;
710 return str_replace($this->sourcepath . DIRECTORY_SEPARATOR, '', $this->path);
715 return $this->source;
720 $info = $this->aggregator->coverageInfo($this->path);
726 if (!isset($this->linelinks)) {
727 $this->linelinks = $this->aggregator->retrieveLineLinks($this->path);
729 if (isset($this->linelinks[$line])) {
730 return $this->linelinks[$line];
762 $this->sqlite = new Sqlite($db, $codepath, $testpath);
763 $this->codepath = $codepath;
764 $this->sqlite->begin();
766 $files = $this->scan($testpath);
776 $id = $this->sqlite->addTest(str_replace('.xdebug', '.phpt', $xdebugfile));
778 $this->retrieveXdebug($xdebugfile, $id);
782 $this->sqlite->updateTotalCoverage();
783 $this->sqlite->commit();
791 return $this->sqlite->retrieveLineLinks($file);
796 return $this->sqlite->retrievePaths();
801 return $this->sqlite->retrievePathsForTest($test);
806 return $this->sqlite->retrieveTestPaths();
811 return $this->sqlite->coveragePercentage($sourcefile, $testfile);
816 return $this->sqlite->retrievePathCoverage($path);
821 return $this->sqlite->retrievePathCoverageByTest($path, $test);
826 return $this->sqlite->retrieveCoverage($path);
831 return $this->sqlite->retrieveCoverageByTest($path, $test);
838 $this->sqlite->addCoverage(str_replace('.xdebug', '.phpt', $path), $testid, $xdebug);
849 $this->testpath = $testpath;
878 if ($this->sqlite->unChangedXdebug($path)) {
890 foreach ($this->sqlite->retrieveTestPaths() as $path) {
897 $this->sqlite->removeOldTest($path, $xdebugpath);
904 $decorator = new DefaultSourceDecorator($toPath, $this->testpath, $this->codepath);
906 $coverage = $this->sqlite->retrieveProjectCoverage();
908 … $decorator->renderSummary($this, $this->retrievePaths(), $this->codepath, false, $coverage[1],
910 $a = $this->codepath;
912 $decorator->renderTestCoverage($this, $this->testpath, $a);
937 $this->db = new \Sqlite3($path);
940 if (@$this->db->querySingle($sql) == '2.1.0') {
941 $this->codepath = $this->db->querySingle('SELECT codepath FROM paths');
942 $this->testpath = $this->db->querySingle('SELECT testpath FROM paths');
949 $this->codepath = $codepath;
950 $this->testpath = $testpath;
953 $this->db->exec('
962 $this->db->exec('BEGIN');
987 $worked = $this->db->exec($query);
989 @$this->db->exec('ROLLBACK');
990 $error = $this->db->lastErrorMsg();
1004 $worked = $this->db->exec($query);
1006 @$this->db->exec('ROLLBACK');
1007 $error = $this->db->lastErrorMsg();
1017 $worked = $this->db->exec($query);
1019 @$this->db->exec('ROLLBACK');
1020 $error = $this->db->lastErrorMsg();
1031 $worked = $this->db->exec($query);
1033 @$this->db->exec('ROLLBACK');
1034 $error = $this->db->lastErrorMsg();
1050 INSERT INTO paths ("' . $this->db->escapeString($codepath) . '", "' .
1051 $this->db->escapeString($testpath). '")';
1052 $worked = $this->db->exec($query);
1054 @$this->db->exec('ROLLBACK');
1055 $error = $this->db->lastErrorMsg();
1058 $this->db->exec('COMMIT');
1063 $id = $this->getFileId($file);
1069 $result = $this->db->query($query);
1071 $error = $this->db->lastErrorMsg();
1086 $result = $this->db->query($query);
1088 $error = $this->db->lastErrorMsg();
1100 $id = $this->getTestId($test);
1117 $result = $this->db->query($query);
1119 $error = $this->db->lastErrorMsg();
1136 $result = $this->db->query($query);
1138 $error = $this->db->lastErrorMsg();
1151 $coverage = $this->retrievePathCoverageByTest($sourcefile, $testfile);
1153 $coverage = $this->retrievePathCoverage($sourcefile);
1160 if ($this->totallines) {
1161 return array($this->coveredlines, $this->totallines);
1166 $result = $this->db->query($query);
1168 $error = $this->db->lastErrorMsg();
1172 $this->pathTotal[$res[1]] = $res[0];
1173 $this->totallines += $res[0];
1179 $result = $this->db->query($query);
1181 $error = $this->db->lastErrorMsg();
1185 $this->pathCovered[$res[1]] = $res[0];
1186 $this->coveredlines += $res[0];
1189 return array($this->coveredlines, $this->totallines);
1194 if (!$this->totallines) {
1196 $this->retrieveProjectCoverage();
1198 if (!isset($this->pathCovered[$path])) {
1201 return array($this->pathCovered[$path], $this->pathTotal[$path]);
1206 $id = $this->getFileId($path);
1207 $testid = $this->getTestId($test);
1212 $result = $this->db->query($query);
1214 $error = $this->db->lastErrorMsg();
1227 $result = $this->db->query($query);
1229 $error = $this->db->lastErrorMsg();
1243 $id = $this->getFileId($path);
1244 $testid = $this->getTestId($test);
1248 $result = $this->db->query($query);
1250 $error = $this->db->lastErrorMsg();
1265 $stmt = $this->db->prepare($query);
1279 $stmt = $this->db->prepare($query);
1293 $id = $this->getTestId($testpath);
1296 return $this->db->querySingle('SELECT COUNT(id) from tests')+1;
1298 $this->db->exec('DELETE FROM tests WHERE id=' . $id);
1299 $this->db->exec('DELETE FROM coverage WHERE tests_id=' . $id);
1300 …$this->db->exec('DELETE FROM xdebugs WHERE xdebugpath="' . $this->db->escapeString($xdebugpath) . …
1306 $id = $this->removeOldTest($testpath, str_replace('.phpt', '.xdebug', $testpath));
1310 $stmt = $this->db->prepare($query);
1315 $id = $this->db->lastInsertRowID();
1320 $stmt = $this->db->prepare($query);
1332 $stmt = $this->db->prepare($query);
1354 $stmt = $this->db->prepare($query);
1361 $stmt = $this->db->prepare($query);
1374 $stmt = $this->db->prepare($query);
1382 return $this->db->lastInsertRowID();
1388 WHERE files_id=' . $this->getFileId($file) . ' AND linenumber=' . $linenumber;
1389 $result = $this->db->query($query);
1402 $id = $this->getFileId($path);
1406 $result = $this->db->query($query);
1408 $error = $this->db->lastErrorMsg();
1427 $result = $this->db->query($query);
1429 $error = $this->db->lastErrorMsg();
1443 $this->db->exec($query);
1445 foreach ($this->retrievePaths() as $path) {
1447 $id = $this->getFileId($path);
1448 foreach ($this->retrieveSlowCoverage($id) as $linenumber => $coverage) {
1452 $this->db->exec($query);
1464 if (strpos($path, $this->codepath) !== 0) {
1467 if (strpos($path, $this->testpath) === 0) {
1474 $id = $this->addFile($path, $issource);
1485 $worked = $this->db->exec($query);
1487 $error = $this->db->lastErrorMsg();
1497 $this->db->exec('BEGIN');
1502 $this->db->exec('COMMIT');
1514 $paths = $this->retrievePaths(1);
1520 $this->db->escapeString($path) . '"';
1521 $result = $this->db->query($query);
1534 $result2 = $this->db->query($query);
1544 $paths = $this->retrieveTestPaths();
1550 $this->db->escapeString($path) . '"';
1551 $result = $this->db->query($query);
1574 $this->testname = $testname;
1580 $this->coverage = $this->aggregator->retrieveCoverageByTest($this->path, $this->testname);
1585 $info = $this->aggregator->coverageInfoByTest($this->path, $this->testname);
1594 return $decorator->render($this, $this->testname);
1599 return $this->aggregator->coveragePercentage($this->path, $this->testname);