<div dir="ltr">On Fri, Jul 26, 2013 at 7:07 AM, adam <span dir="ltr"><<a href="mailto:adamgsoc2013@gmail.com" target="_blank">adamgsoc2013@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<div><div class="h5"><br>
>Hi,<br>
>I am trying to write unit tests for libraries/sql.lib.php script. I tried<br>
>several times to write successful test cases  but I was not successful. I<br>
>think it is because I am missing some variable initialization. I tried to<br>
>find where I am missing but I was not successful. I would appreciate if<br>
>someone can provide me a sample test case for a method (for example<br>
>PMA_getNewDatabase method in sql.lib.php) or any reference that I can refer<br>
>to gain the required knowledge.<br>
><br>
<br>
</div></div>You can do variable initialization on the Setup function, Look the code example here:<br>
<a href="https://github.com/adamgsoc2013/phpmyadmin/blob/ed36426b8863645076a3bc6ed6bf88b7de7b6973/test/classes/PMA_TableSearch_test.php#L38" target="_blank">https://github.com/adamgsoc2013/phpmyadmin/blob/ed36426b8863645076a3bc6ed6bf88b7de7b6973/test/classes/PMA_TableSearch_test.php#L38</a><br>

<br>
>Thank you<br>
>Regards Supun<br>
><br>
<br>
Thanks,<br>
Adam<br>
<div class=""><div class="h5">------------------------------------------------------------------------------<br>
See everything from the browser to the database with AppDynamics<br>
Get end-to-end visibility with application monitoring from AppDynamics<br>
Isolate bottlenecks and diagnose root cause in seconds.<br>
Start your free trial of AppDynamics Pro today!<br>
<a href="http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk</a><br>
_______________________________________________<br>
Phpmyadmin-devel mailing list<br>
<a href="mailto:Phpmyadmin-devel@lists.sourceforge.net">Phpmyadmin-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
</div></div></blockquote></div><br>Hi Marc,</div><div class="gmail_extra">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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">[1] - <a href="https://github.com/scnakandala/phpmyadmin/compare/gsoc_2013">https://github.com/scnakandala/phpmyadmin/compare/gsoc_2013</a><br clear="all"><div><br>
</div>-- <br>Thank you<br>Supun Nakandala<br>Dept. Computer Science and Engineering<br>University of Moratuwa<br>
</div></div>