CodeIgniter Forums
ci-phpunit-test for CodeIgniter 3.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: ci-phpunit-test for CodeIgniter 3.0 (/showthread.php?tid=61725)

Pages: 1 2 3 4 5 6 7 8 9 10 11


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 06-18-2015

v0.2.0 was released:
https://github.com/kenjis/ci-phpunit-test/releases

Only changes MY_url_helper.php as sample, and imporved documentation.

If you use new MY_url_helper.php (you have to install manually), redirect() throws PHPUnit_Framework_Exception. So you can know redirect() called easily.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-09-2015

I added docsĀ to use mocks in `request()`:
https://github.com/kenjis/ci-phpunit-test/blob/master/docs/HowToWriteTests.md#request-and-use-mocks

If you guys have any questions or problem to write tests, feel free to ask.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-11-2015

I created PR which contains BC break in `request()` method:
https://github.com/kenjis/ci-phpunit-test/pull/22

If you have any opinions, feel free to comment.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-13-2015

v0.3.0 was released:
https://github.com/kenjis/ci-phpunit-test/releases

* 4th param $callable of $this->request() and $this->ajaxRequest() is now deprecated. Use $this->request->setCallable().
* You can enable hooks for controller in controller testing. $this->request->enableHooks() is added.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-20-2015

I've been improving documentation for ci-phpunit-test v0.4.0: https://github.com/kenjis/ci-phpunit-test/blob/master/docs/HowToWriteTests.md

Feedback is welcome.

v0.4.0 will be released soon.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-20-2015

v0.4.0 was released:
https://github.com/kenjis/ci-phpunit-test/releases

I recommend all users to upgrade.

* Now you can test controller's response code
* Now you can test `redirect()` more easily


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-23-2015

I'm going to release v0.5.0 next week.

On the version, you can test code contains `exit()`. New feature enables converting exit() to Exception on the fly.

If you have interested in it, please try `dev-master`. Feedback is welcome.

See https://github.com/kenjis/ci-phpunit-test/blob/master/docs/ChangeLog.md#v050-not-released


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-27-2015

v0.5.0 was released:
https://github.com/kenjis/ci-phpunit-test/releases
  • Now you don't have to create MY_url_helper for testing redirect()
  • Now you can test your apps that contains exit()
  • Now you can inject your mock into controller constructors
I wrote an article about exit():
Now you can write tests for Codeigniter 3.0 apps that contains exit() with ci-phpunit-test


RE: CI PHPUnit Test for CodeIgniter 3.0 - solidcodes - 07-27-2015

Nice work dude.


RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 07-31-2015

(07-27-2015, 02:34 AM)solidcodes Wrote: Nice work dude.

Thank you!