/**
  * 
  */
 public function testIsLessThan()
 {
     $this->assertTrue(Inspekt::isLessThan('a', 'b'));
 }
Exemple #2
0
 /**
  * Returns value if it is less than $max, FALSE otherwise.
  *
  * @param mixed $key
  * @param mixed $max
  * @return mixed
  *
  * @tag validator
  */
 function testLessThan($key, $max = NULL)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Inspekt::isLessThan($this->_getValue($key), $max)) {
         return $this->_getValue($key);
     }
     return FALSE;
 }
Exemple #3
0
 /**
  * Returns value if it is less than $max, FALSE otherwise.
  *
  * @param mixed $key
  * @param mixed $max
  * @return mixed
  * @throws Exception
  * @tag validator
  */
 public function testLessThan($key, $max = null)
 {
     $value = $this->getValueOrNull($key);
     if (!is_null($value) && Inspekt::isLessThan($value, $max)) {
         return $value;
     }
     return false;
 }