WP unit tests fix

+ new database tests
+ database mock test