<?php /** * $Id$ * * @package Mediboard * @subpackage developpement * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $root_dir = CAppUI::conf("root_dir"); $extensions = array("php"); $ignored = array("classes/", "locales/", "controllers/", "shell/", "/index.php", "/setup.php", "/config.php", "/configuration.php", "/preferences.php"); $views = CMbPath::getPathTreeUnder("{$root_dir}/modules", $ignored, $extensions); $count = CMbArray::countLeafs($views); // Création du template $smarty = new CSmartyDP(); $smarty->assign("views", $views); $smarty->assign("count", $count); $smarty->display("regression_checker.tpl");
public function testCountLeafs() { $this->assertEquals(1, $this->stub->countLeafs(null)); $this->assertEquals(3, $this->stub->countLeafs(array("val", array("val2", array("val3"))))); }
* * @package Mediboard * @subpackage developpement * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); if (!class_exists("CMbCodeSniffer")) { CAppUI::stepMessage(UI_MSG_WARNING, "CMbCodeSniffer-error-PEAR_needed"); return; } $sniffer = new CMbCodeSniffer(); $files = $sniffer->getFilesTree(); //unset($files["modules"]); $count = CMbArray::countLeafs($files); $reports = $sniffer->checkReports($files); $stats = $sniffer->buildStats($files); $types = $stats["-root-"]; $existing_reports = $reports; CMbArray::removeValue("none", $existing_reports); $existing_count = count($existing_reports); // Cuz sniffer changes work dir but restores it at destruction // Be aware that unset() won't call __destruct() anyhow $sniffer->__destruct(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("files", $files); $smarty->assign("count", $count); $smarty->assign("types", $types); $smarty->assign("reports", $reports);