[Phpmyadmin-devel] How to write unit test cases for DBI class?
adamgsoc2013 at gmail.com
Wed Jul 31 17:50:33 CEST 2013
I am writing unit test cases for DBI classes. in the code base: , including DBI class:
But I have no idea how to test them.
1. Mock built-in PHP DB client API ( ig: mysql_connect)
they call PHP DB client API finally, but I don't know how I can mock this kind of built-in functions
2. DB real operations
If try to test with real data, I think It is not accessible, because I need to connect to DB with username and password.
so I think method 1 is more flexible, Can someone give me some advice? thanks
More information about the Developers