Fixed flakey tests

Assuming return value of time() and microtime() will increment by 1 when called every time, some issues will appear. (microtime(true) - $time will always greater than 1.) Also, $config is possible to be null when calling set_config.
Why? $config could be null when calling set_config, and this will cause the run time exception. I met this problem when running the test.