* Add metric test.
This commit is contained in:
@@ -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');
|
||||
@@ -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');
|
||||
Reference in New Issue
Block a user