How to use PHPUnit (CIUnit) with CodeIgniter 2.1.0 |
[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.
[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-v...a-run-box/ but still the same..
[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
[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?
[eluser]SPeed_FANat1c[/eluser]
Accidentally found maybe an easier way to install PHP unit - its Composer. http://net.tutsplus.com/tutorials/php/te...rst-steps/ Composer is "Dependency Manager for PHP". I did not tried it but watched video, maybe someone will have less headache when installing PEAR
[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?. |
Welcome Guest, Not a member yet? Register Sign In |