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; $gray = $unusedValue;
$green = $orange = $red = 0; $green = $orange = $red = 0;
// TODO(#6122): Add proper treshold parsing. // TODO(#6122): Add proper treshold parsing.
if ($perfdata->getCriticalTreshold() && $perfdata->getValue() > $perfdata->getCriticalTreshold()) { if ($perfdata->getCriticalThreshold() && $perfdata->getValue() > $perfdata->getCriticalThreshold()) {
$red = $usedValue; $red = $usedValue;
} elseif ($perfdata->getWarningTreshold() && $perfdata->getValue() > $perfdata->getWarningTreshold()) { } elseif ($perfdata->getWarningThreshold() && $perfdata->getValue() > $perfdata->getWarningThreshold()) {
$orange = $usedValue; $orange = $usedValue;
} else { } else {
$green = $usedValue; $green = $usedValue;

View File

@ -44,18 +44,18 @@ class Perfdata
protected $maxValue; protected $maxValue;
/** /**
* The WARNING treshold * The WARNING threshold
* *
* @var string * @var string
*/ */
protected $warningTreshold; protected $warningThreshold;
/** /**
* The CRITICAL treshold * The CRITICAL threshold
* *
* @var string * @var string
*/ */
protected $criticalTreshold; protected $criticalThreshold;
/** /**
* Create a new Perfdata object based on the given performance data value * Create a new Perfdata object based on the given performance data value
@ -180,9 +180,9 @@ class Perfdata
* *
* @return null|string * @return null|string
*/ */
public function getWarningTreshold() public function getWarningThreshold()
{ {
return $this->warningTreshold; return $this->warningThreshold;
} }
/** /**
@ -190,9 +190,9 @@ class Perfdata
* *
* @return null|string * @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); $this->minValue = self::convert($parts[3], $this->unit);
case 3: case 3:
// TODO(#6123): Tresholds have the same UOM and need to be converted as well! // 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: case 2:
// TODO(#6123): Tresholds have the same UOM and need to be converted as well! // 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( $this->assertEquals(
'10', '10',
Perfdata::fromString('1;10')->getWarningTreshold(), Perfdata::fromString('1;10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values' 'Perfdata::getWarningTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'10:', '10:',
Perfdata::fromString('1;10:')->getWarningTreshold(), Perfdata::fromString('1;10:')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values' 'Perfdata::getWarningTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'~:10', '~:10',
Perfdata::fromString('1;~:10')->getWarningTreshold(), Perfdata::fromString('1;~:10')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values' 'Perfdata::getWarningTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'10:20', '10:20',
Perfdata::fromString('1;10:20')->getWarningTreshold(), Perfdata::fromString('1;10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values' 'Perfdata::getWarningTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'@10:20', '@10:20',
Perfdata::fromString('1;@10:20')->getWarningTreshold(), Perfdata::fromString('1;@10:20')->getWarningThreshold(),
'Perfdata::getWarningTreshold does not return correct values' 'Perfdata::getWarningTreshold does not return correct values'
); );
} }
@ -90,27 +90,27 @@ class PerfdataTest extends BaseTestCase
{ {
$this->assertEquals( $this->assertEquals(
'10', '10',
Perfdata::fromString('1;;10')->getCriticalTreshold(), Perfdata::fromString('1;;10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values' 'Perfdata::getCriticalTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'10:', '10:',
Perfdata::fromString('1;;10:')->getCriticalTreshold(), Perfdata::fromString('1;;10:')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values' 'Perfdata::getCriticalTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'~:10', '~:10',
Perfdata::fromString('1;;~:10')->getCriticalTreshold(), Perfdata::fromString('1;;~:10')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values' 'Perfdata::getCriticalTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'10:20', '10:20',
Perfdata::fromString('1;;10:20')->getCriticalTreshold(), Perfdata::fromString('1;;10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values' 'Perfdata::getCriticalTreshold does not return correct values'
); );
$this->assertEquals( $this->assertEquals(
'@10:20', '@10:20',
Perfdata::fromString('1;;@10:20')->getCriticalTreshold(), Perfdata::fromString('1;;@10:20')->getCriticalThreshold(),
'Perfdata::getCriticalTreshold does not return correct values' 'Perfdata::getCriticalTreshold does not return correct values'
); );
} }
@ -147,7 +147,7 @@ class PerfdataTest extends BaseTestCase
{ {
$perfdata = Perfdata::fromString('1;;3;5'); $perfdata = Perfdata::fromString('1;;3;5');
$this->assertNull( $this->assertNull(
$perfdata->getWarningTreshold(), $perfdata->getWarningThreshold(),
'Perfdata objects do not return null for missing warning tresholds' 'Perfdata objects do not return null for missing warning tresholds'
); );
$this->assertNull( $this->assertNull(