Hi,
I wrote the selenium test for code written to automate normalization to 1NF. Here is the pull request[0]. I was expecting the code coverage reported by coverall will increase at least 1 to 2% but it didn't. Means selenium test doesn't increase coverage ? May be because it seems to cover only the behaviour of the system. If it is the case then how to cover the code segments which interact with database ? Is there a way to write test cases for codes interacting with databases using normal phpUnit framework ?
[0] https://github.com/phpmyadmin/phpmyadmin/pull/1271
Thanks and Regards - Smita
Hi
Dne Fri, 4 Jul 2014 11:29:20 +0530 Smita kumarismita62@gmail.com napsal(a):
I wrote the selenium test for code written to automate normalization to 1NF. Here is the pull request[0]. I was expecting the code coverage reported by coverall will increase at least 1 to 2% but it didn't. Means selenium test doesn't increase coverage ? May be because it seems to cover only the behaviour of the system.
The coverage reporting in PHPUnit with Selenium was quite broken, so I've disabled it. If it's now working, we can try enabling that (maybe reverting 2a99cac and e3e0f33 will be enough, but that needs some testing).
If it is the case then how to cover the code segments which interact with database ? Is there a way to write test cases for codes interacting with databases using normal phpUnit framework ?
You can mock the DBI (see eg. test/classes/PMA_TableReplaceSearch_test.php).
On Fri, Jul 4, 2014 at 1:00 PM, Michal Čihař michal@cihar.com wrote:
Hi
Dne Fri, 4 Jul 2014 11:29:20 +0530 Smita kumarismita62@gmail.com napsal(a):
I wrote the selenium test for code written to automate normalization to 1NF. Here is the pull request[0]. I was expecting the code coverage reported by coverall will increase at least 1 to 2% but it didn't. Means selenium test doesn't increase coverage ? May be because it seems to
cover
only the behaviour of the system.
The coverage reporting in PHPUnit with Selenium was quite broken, so I've disabled it. If it's now working, we can try enabling that (maybe reverting 2a99cac and e3e0f33 will be enough, but that needs some testing).
If it is the case then how to cover the code segments which interact with database ? Is there a way to write test cases for codes interacting with databases using normal phpUnit framework ?
You can mock the DBI (see eg. test/classes/PMA_TableReplaceSearch_test.php).
Yeah, Thanks. I'll try this. :-)
-- Michal Čihař | http://cihar.com | http://phpmyadmin.net
Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel