![]() |
How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 (/showthread.php?tid=48438) |
How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 10-17-2012 [eluser]SPeed_FANat1c[/eluser] Hello again, I still have problems with running the first test ![]() Code: Darius@Darius-PC /cygdrive/e/projektai/php projektai/htdocs/ci_unit/tests why it cannot open the file, I don't get? the same is when I don't specify the file Code: Darius@Darius-PC /cygdrive/e/projektai/php projektai/htdocs/ci_unit/tests Oh, btw I tried it with windows native cmd and it did not throw this error, it told that cannot connect to database and so on, so I will fix the connection settings and will check. How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 10-20-2012 [eluser]SPeed_FANat1c[/eluser] So I fixed the connection settings, but still getting error: Code: E:\projektai\php projektai\htdocs\ci_unit\tests>phpunit Then I open the file E:\projektai\php projektai\htdocs\ci_u nit\application\config\testing\database.php to see whats on 41 line, and I see empty file. But it takes 4 KB. So it should not be empty. What is wrong there? Edit: tired opening it with few other editrods, and when opening with notepad then it shows acces s denied message. So its somehow locked and phpunit also probably cannot open it or something like that. What is going on ![]() I also tried running cmd as administrator: http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/ but still the same.. How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 10-22-2012 [eluser]SPeed_FANat1c[/eluser] I replaced the database.php in application/config/testing with the file application/config/database.php and it started working. Code: E:\projektai\php projektai\htdocs\ci_unit\tests>phpunit So cool, I will be able now experiment with php unit. I hope I will not get those nonsenses anymore with this ciunit ![]() How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 10-23-2012 [eluser]SPeed_FANat1c[/eluser] Btw, I assume this Code: ←[30;42m←[2K had to mean color coding for command line. But I am not seeing colors. How to make that it would show colors instead of code on windows cmd? How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 10-27-2012 [eluser]SPeed_FANat1c[/eluser] Accidentally found maybe an easier way to install PHP unit - its Composer. http://net.tutsplus.com/tutorials/php/test-driven-development-in-php-first-steps/ Composer is "Dependency Manager for PHP". I did not tried it but watched video, maybe someone will have less headache when installing PEAR ![]() How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 - El Forum - 03-11-2013 [eluser]Unknown[/eluser] [quote author="Kenji @ CodeIgniter Users Group in Japan" date="1331259973"]The way to truncate the tables in CIUnit is not good. Any contributions is welcome. :-) [/quote] Is there way to have "Unit tests do not connect to the database" instead mock out the database layer entirely with CIUnit?. |