Welcome Guest, Not a member yet? Register   Sign In
ci-phpunit-test for CodeIgniter 3.0
#31

v0.8.1 bug fix version was released.
https://github.com/kenjis/ci-phpunit-test/releases
Reply
#32

Now ci-phpunit-test dev-master supports PHP7!
https://travis-ci.org/kenjis/ci-phpunit-...s/83617994
Reply
#33

v0.8.2 bug fix version was released.
https://github.com/kenjis/ci-phpunit-test/releases
  • Compatible with CodeIgniter 3.0.2
  • Compatible with PHP 7.0.0-RC4
Reply
#34

This is great software with great documentation, however I still have one issue.

I don't know how to set private properties in my controllers. Several of my controllers have methods whose functionality depends on protected arrays set in core/My_Controller. I want to write tests which will be able to set this private properties. Is this possible and how to do it?

I'm using Codeigniter 3.0.0, PHPUnit 5.0.5 and CI PHPUnit Test 0.8.2

Thanks in advance

P.S I'm new to this forum and I hope this is the right place for this question.
Reply
#35

(10-12-2015, 06:29 AM)nighthawk Wrote: This is great software with great documentation, however I still have one issue.

I don't know how to set private properties in my controllers. Several of my controllers have methods whose functionality depends on protected arrays set in core/My_Controller. I want to write tests which will be able to set this private properties. Is this possible and how to do it?

I'm using Codeigniter 3.0.0, PHPUnit 5.0.5 and CI PHPUnit Test 0.8.2

Thanks in advance

P.S I'm new to this forum and I hope this is the right place for this question.
Welcome to the forum. You're in the right place.

ci-phpunit-test has a helper method for it:
https://github.com/kenjis/ci-phpunit-tes...erty-value
Reply
#36

If you have installed HMVC, ci-phpunit-test did not work because of error.
Today I commited the change not to cause the error. If you apply the patch below, you can run phpunit without errors.

Code:
--- a/application/third_party/MX/Modules.php
+++ b/application/third_party/MX/Modules.php
@@ -2,7 +2,7 @@

(defined('EXT')) OR define('EXT', '.php');

-global $CFG;
+$CFG =& load_class('Config');

/* get module locations from config settings or use the default module location and offset */
is_array(Modules::$locations = $CFG->item('modules_locations')) OR Modules::$locations = array(

But I still don't know HMVC and ci-phpunit work fine or not.
If there is someone who wants to use HMVC and ci-phpunit-test, please test master branch of ci-phpunit-test.
Reply
#37

It seems there is still a bit long way to work with HMVC.

If there is someone who try it, see https://github.com/kenjis/ci-phpunit-tes...-149083614
Reply
#38

こんにちわ かえんぎ さん お げんき です か

I must admit this is really interesting. I have never studied unit testing and tend to just test my controllers by typing and changing the input and seeing if any of my views break. Look forward to reading your book.

Thank you for all your hard work so far.
Practical guide to IgnitedCMS - Book coming soon
Reply
#39

(10-18-2015, 11:09 PM)iamthwee Wrote: こんにちわ かえんぎ さん お げんき です か

I must admit this is really interesting. I have never studied unit testing and tend to just test my controllers by typing and changing the input and seeing if any of my views break. Look forward to reading your book.

Thank you for all your hard work so far.

Hi, your Japanese is a bit funny. Who is かえんぎ?

Thank you for your interest. I have just published the second release of the book.
http://forum.codeigniter.com/thread-6294...#pid324344
Reply
#40

Sorry it was supposed to be ka-e-n-gi = kenjis but to be honest I'm not sure how names translate using hirigana Big Grin

Anyway on topic, look forward to the release, did you guys decide on the cover?
Practical guide to IgnitedCMS - Book coming soon
Reply




Theme © iAndrew 2016 - Forum software by © MyBB