[Phpmyadmin-devel] writing unit tests to sql.lib.php

Hi, I am trying to write unit tests for libraries/sql.lib.php script. I tried several times to write successful test cases but I was not successful. I think it is because I am missing some variable initialization. I tried to find where I am missing but I was not successful. I would appreciate if someone can provide me a sample test case for a method (for example PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer to gain the required knowledge. Thank you Regards Supun

Le 2013-07-25 13:11, Supun Nakandala a écrit :
Hi, I am trying to write unit tests for libraries/sql.lib.php script. I tried several times to write successful test cases but I was not successful. I think it is because I am missing some variable initialization. I tried to find where I am missing but I was not successful. I would appreciate if someone can provide me a sample test case for a method (for example PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer to gain the required knowledge.
Hi Supun, do you have a branch in your repository where we could see your attempts? It might be easier for a developer to find the problem. I assume you have looked at the existing tests to gain some knowledge, and have read http://wiki.phpmyadmin.net/pma/Unit_Testing -- Marc Delisle http://infomarc.info

Hi,
Hi, I am trying to write unit tests for libraries/sql.lib.php script. I tried several times to write successful test cases but I was not successful. I think it is because I am missing some variable initialization. I tried to find where I am missing but I was not successful. I would appreciate if someone can provide me a sample test case for a method (for example PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer to gain the required knowledge.
You can do variable initialization on the Setup function, Look the code example here: https://github.com/adamgsoc2013/phpmyadmin/blob/ed36426b8863645076a3bc6ed6bf...
Thank you Regards Supun
Thanks, Adam

On Fri, Jul 26, 2013 at 7:07 AM, adam <adamgsoc2013@gmail.com> wrote:
Hi,
Hi, I am trying to write unit tests for libraries/sql.lib.php script. I tried several times to write successful test cases but I was not successful. I think it is because I am missing some variable initialization. I tried to find where I am missing but I was not successful. I would appreciate if someone can provide me a sample test case for a method (for example PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer to gain the required knowledge.
You can do variable initialization on the Setup function, Look the code example here:
https://github.com/adamgsoc2013/phpmyadmin/blob/ed36426b8863645076a3bc6ed6bf...
Thank you Regards Supun
Thanks, Adam
------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Hi Marc, I was able to write some successful test cases for sql.lib.php. [1] is the branch that I am working on. The last test case is still not working. I am working on it. [1] - https://github.com/scnakandala/phpmyadmin/compare/gsoc_2013 -- Thank you Supun Nakandala Dept. Computer Science and Engineering University of Moratuwa

Le 2013-07-26 15:57, Supun Nakandala a écrit :
On Fri, Jul 26, 2013 at 7:07 AM, adam <adamgsoc2013@gmail.com <mailto:adamgsoc2013@gmail.com>> wrote:
Hi,
>Hi, >I am trying to write unit tests for libraries/sql.lib.php script. I tried >several times to write successful test cases but I was not successful. I >think it is because I am missing some variable initialization. I tried to >find where I am missing but I was not successful. I would appreciate if >someone can provide me a sample test case for a method (for example >PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer >to gain the required knowledge. >
You can do variable initialization on the Setup function, Look the code example here: https://github.com/adamgsoc2013/phpmyadmin/blob/ed36426b8863645076a3bc6ed6bf...
>Thank you >Regards Supun >
Thanks, Adam
Hi Marc, I was able to write some successful test cases for sql.lib.php. [1] is the branch that I am working on. The last test case is still not working. I am working on it.
[1] - https://github.com/scnakandala/phpmyadmin/compare/gsoc_2013
Hi Supun, I'll look at your test cases later. I have told you before, perhaps I was not clear enough. Please use meaningful names for your branches. You are alternating between gsoc_2013 and gsoc_2013_2 which is not meaningful. For example, this branch could be called sql-lib-unit-tests. -- Marc Delisle http://infomarc.info
participants (3)
-
adam
-
Marc Delisle
-
Supun Nakandala