using a type cast instead, otherwise an empty string gets converted to
true when set with bool type.
Change-Id: I4161de32151a649161ab4084e80cafe4a462c7d5
$value = (float)$value;
break;
case 'bool':
- if ( is_string( $value ) ) {
- $value = $value !== '0';
- } elseif ( is_int( $value ) ) {
- $value = $value !== 0;
- }
+ $value = (bool)$value;
break;
case 'array':
if ( is_string( $value ) ) {
);
}
+ /**
+ * @since 1.21
+ * @return array
+ */
+ protected function getMockValues() {
+ return array(
+ 'id' => 1,
+ 'str' => 'foobar4645645',
+ 'int' => 42,
+ 'float' => 4.2,
+ 'bool' => '',
+ 'array' => array( 42, 'foobar' ),
+ 'blob' => new stdClass()
+ );
+ }
+
}
class TestORMRow extends ORMRow {}