• 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ci-phpunit-test for CodeIgniter 3.0

#1
Hi, I'm building a new tool for CodeIgniter 3.0.

CI PHPUnit Test: It is an easier way to use PHPUnit with CodeIgniter 3.0.
You don't have to modify CodeIgniter core files at all!
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#2
Sorry, I've just changed folder structure and added new files.

tests/replace/ -> tests/_ci_phpunit_test/replacing/

If you update CI PHPUnit Test, please copy (overwrite) to "application/tests" folder and remove "application/tests/replace" folder.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#3
I've been fixing some bugs and improving, and now you can run tests on NetBeans.
[Image: attachment.php?aid=210]

And I added Function/Class Reference:
https://github.com/kenjis/ci-phpunit-tes...-reference


Attached Files Thumbnail(s)
   
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#4
I added helper methods to build mocks.
https://github.com/kenjis/ci-phpunit-tes...-reference

And I changed method naming of the class to camelCase. Because PHPUnit_Framework_TestCase uses camelCase.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#5
I got reported trouble with autoload Session.

I added the fix:
https://github.com/kenjis/ci-phpunit-tes...5f38493f13

If you have the same problem, try the latest master branch, please.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#6
Thanks to a contributer, rochefort, now we can test 404 and 500 requests.
https://github.com/kenjis/ci-phpunit-tes...d-show_404
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#7
After my last post, I fixed:

* problem with CodeIgniter autoload completely
* $this->request()
* @runInSeparateProcess error

And I changed a lot internally according to feedbacks.

get_new_instance() is now deprecated. Please use reset_instance() instead.
https://github.com/kenjis/ci-phpunit-tes...ter-object

Now ci-phpunit-test loads MY_Loader. If you have it, use it with caution.
https://github.com/kenjis/ci-phpunit-test#my_loader

I recommend all users to reinstall latest ci-phpunit-test.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#8
Thanks to feedback from around the world, ci-phpunit-test has improved greatly.

I've just made the first release!
https://github.com/kenjis/ci-phpunit-test/releases

And I added more documentation how to write tests.
https://github.com/kenjis/ci-phpunit-tes...teTests.md

I recommend trying ci-phpunit-test to all CodeIgniter users who want to write application tests with PHPUnit.
https://github.com/kenjis/ci-phpunit-test
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#9
I wrote introductory blog article.

Testing Codeigniter 3.0 applications with PHPUnit
http://blog.a-way-out.net/blog/2015/06/1...3-phpunit/
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply

#10
A few bugs found. So I fixed and released v0.1.1:
https://github.com/kenjis/ci-phpunit-test/releases

And if you installed CodeIgniter via official Zip file, you can install CI PHPUnit Test more easily than before.
Do you want to write tests for your apps? Our book, CodeIgniter Testing Guide would help you.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.