Ejemplo n.º 1
0
 /**
  * Setter function for integer type.
  */
 protected function setInteger($property, $value)
 {
     try {
         $this->{$property} = LoggerOptionConverter::toIntegerEx($value);
     } catch (Exception $ex) {
         $value = var_export($value, true);
         $this->warn("Invalid value given for '{$property}' property: [{$value}]. Expected an integer. Property not changed.");
     }
 }
 /**
  * Test fail on boolean.
  * @expectedException LoggerException
  * @expectedExceptionMessage Given value [false] cannot be converted to integer.
  */
 public function testToIntegerFailure5()
 {
     LoggerOptionConverter::toIntegerEx(false);
 }