* Add metric test.

This commit is contained in:
songchenxuan
2023-12-21 15:54:25 +08:00
parent d7ea0d484e
commit 9131de137c
4 changed files with 76 additions and 1 deletions
+37 -1
View File
@@ -24,7 +24,7 @@ class metricTest
$tester->dbh->exec(file_get_contents($sqlFile));
}
/**
/**
* 测试 getByID 方法。
* Test getByID method.
*
@@ -519,6 +519,42 @@ class metricTest
return $this->objectModel->genDataZoom($dataLength, $initZoom, $axis);
}
/**
* Test getCalcRoot.
*
* @access public
* @return string
*/
public function getCalcRootTest()
{
$path = $this->objectModel->getCalcRoot();
return substr($path, -19);
}
/**
* Test getDatasetPath.
*
* @access public
* @return string
*/
public function getDatasetPathTest()
{
$path = $this->objectModel->getDatasetPath();
return substr($path, -25);
}
/**
* Test getBaseCalcPath.
*
* @access public
* @return string
*/
public function getBaseCalcPathTest()
{
$path = $this->objectModel->getBaseCalcPath();
return substr($path, -28);
}
/**
* Test parseSqlFunction.
*
@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php
/**
title=getBaseCalcPath
cid=1
pid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/calc.class.php';
$metric = new metricTest();
r($metric->getBaseCalcPathTest()) && p() && e('module/metric/calc.class.php');
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php
/**
title=getCalcRoot
cid=1
pid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/calc.class.php';
$metric = new metricTest();
r($metric->getCalcRootTest()) && p() && e('module/metric/calc/');
@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php
/**
title=getDatasetPath
cid=1
pid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/calc.class.php';
$metric = new metricTest();
r($metric->getDatasetPathTest()) && p() && e('module/metric/dataset.php');