PHP Class RedUNIT\Base\Typechecking

Tests whether RedBeanPHP handles type casting correctly.
Author: Gabor de Mooij and the RedBeanPHP Community
Inheritance: extends RedUNIT\Base
Show file Open project: gabordemooij/redbean

Public Methods

Method Description
testBeanTypeChecking ( ) : void Test bean type checking.
testTypes ( ) : void Test types.

Method Details

testBeanTypeChecking() public method

Test bean type checking.
public testBeanTypeChecking ( ) : void
return void

testTypes() public method

Test how RedBeanPHP OODB and OODBBean handle type and type casts. Rules: 1. before storing a bean all types are preserved except booleans (they are converted to STRINGS '0' or '1') 2. after store-reload all bean property values are STRINGS or NULL (or ARRAYS but that's only from a user perspective because these are lazy loaded) 3. the ID returned by store() is an INTEGER (if possible; on 32 bit systems overflowing values will be cast to STRINGS!) After loading: ALL VALUES EXCEPT NULL -> STRING NULL -> NULL
public testTypes ( ) : void
return void