Fix typing error in 'threshold'

This commit is contained in:
Matthias Jentsch 2014-06-25 15:02:04 +02:00
parent 8839166090
commit 85aed364b7
3 changed files with 23 additions and 23 deletions

View File

@ -61,9 +61,9 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
$gray = $unusedValue;
$green = $orange = $red = 0;
// TODO(#6122): Add proper treshold parsing.
if ($perfdata->getCriticalTreshold() && $perfdata->getValue() > $perfdata->getCriticalTreshold()) {
if ($perfdata->getCriticalThreshold() && $perfdata->getValue() > $perfdata->getCriticalThreshold()) {
$red = $usedValue;
} elseif ($perfdata->getWarningTreshold() && $perfdata->getValue() > $perfdata->getWarningTreshold()) {
} elseif ($perfdata->getWarningThreshold() && $perfdata->getValue() > $perfdata->getWarningThreshold()) {
$orange = $usedValue;
} else {
$green = $usedValue;

View File

@ -44,18 +44,18 @@ class Perfdata
protected $maxValue;
/**
* The WARNING treshold
* The WARNING threshold
*
* @var string
*/
protected $warningTreshold;
protected $warningThreshold;
/**
* The CRITICAL treshold
* The CRITICAL threshold
*
* @var string
*/
protected $criticalTreshold;
protected $criticalThreshold;
/**
* Create a new Perfdata object based on the given performance data value
@ -180,9 +180,9 @@ class Perfdata
*
* @return null|string
*/
public function getWarningTreshold()
public function getWarningThreshold()
{
return $this->warningTreshold;
return $this->warningThreshold;
}
/**
@ -190,9 +190,9 @@ class Perfdata
*
* @return null|string
*/
public function getCriticalTreshold()
public function getCriticalThreshold()
{
return $this->criticalTreshold;
return $this->criticalThreshold;
}
/**
@ -240,10 +240,10 @@ class Perfdata
$this->minValue = self::convert($parts[3], $this->unit);
case 3:
// TODO(#6123): Tresholds have the same UOM and need to be converted as well!
$this->criticalTreshold = trim($parts[2]) ? trim($parts[2]) : null;
$this->criticalThreshold = trim($parts[2]) ? trim($parts[2]) : null;
case 2:
// TODO(#6123): Tresholds have the same UOM and need to be converted as well!
$this->warningTreshold = trim($parts[1]) ? trim($parts[1]) : null;
$this->warningThreshold = trim($parts[1]) ? trim($parts[1]) : null;
}
}

View File

@ -61,27 +61,27 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
'10',
Perfdata::fromString('1;10')->getWarningTreshold(),
Perfdata::fromString('1;10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'10:',
Perfdata::fromString('1;10:')->getWarningTreshold(),
Perfdata::fromString('1;10:')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'~:10',
Perfdata::fromString('1;~:10')->getWarningTreshold(),
Perfdata::fromString('1;~:10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'10:20',
Perfdata::fromString('1;10:20')->getWarningTreshold(),
Perfdata::fromString('1;10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
$this->assertEquals(
'@10:20',
Perfdata::fromString('1;@10:20')->getWarningTreshold(),
Perfdata::fromString('1;@10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values'
);
}
@ -90,27 +90,27 @@ class PerfdataTest extends BaseTestCase
{
$this->assertEquals(
'10',
Perfdata::fromString('1;;10')->getCriticalTreshold(),
Perfdata::fromString('1;;10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'10:',
Perfdata::fromString('1;;10:')->getCriticalTreshold(),
Perfdata::fromString('1;;10:')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'~:10',
Perfdata::fromString('1;;~:10')->getCriticalTreshold(),
Perfdata::fromString('1;;~:10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'10:20',
Perfdata::fromString('1;;10:20')->getCriticalTreshold(),
Perfdata::fromString('1;;10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
$this->assertEquals(
'@10:20',
Perfdata::fromString('1;;@10:20')->getCriticalTreshold(),
Perfdata::fromString('1;;@10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values'
);
}
@ -147,7 +147,7 @@ class PerfdataTest extends BaseTestCase
{
$perfdata = Perfdata::fromString('1;;3;5');
$this->assertNull(
$perfdata->getWarningTreshold(),
$perfdata->getWarningThreshold(),
'Perfdata objects do not return null for missing warning tresholds'
);
$this->assertNull(