![]() |
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) |
RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 10-27-2015 (10-19-2015, 05:03 AM)iamthwee Wrote: Sorry it was supposed to be ka-e-n-gi = kenjis but to be honest I'm not sure how names translate using hirigana My real name is Kenji = ke-n-ji. We did not decide the cover yet. We are still looking for a good photo for the book. RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 11-18-2015 v0.9.0 was released. https://github.com/kenjis/ci-phpunit-test/releases * `$this->request->addCallable()` to add callable. * Autoloading classes in `application/modules` folder. * You can configure search paths for autoloader. RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 11-19-2015 I'm planning to merge the PR: https://github.com/kenjis/ci-phpunit-test/pull/74 It changes $this->getDouble() method. If you have any trouble with your existing test cases when you apply the patch, please let me know. RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 11-22-2015 (11-19-2015, 06:15 PM)kenjis Wrote: I'm planning to merge the PR: https://github.com/kenjis/ci-phpunit-test/pull/74 The PR initially only contains the change of $this->getDouble(). But after all, I got to the conclusion that the reset_instance() implementation was wrong. So I added the fix. I've just merged the PR, so now 1.0.x@dev (dev-master) includes BC break changes. See https://github.com/kenjis/ci-phpunit-test/blob/master/docs/ChangeLog.md#changed for details. RE: CI PHPUnit Test for CodeIgniter 3.0 - kenjis - 11-26-2015 I've just released v0.10.0: https://github.com/kenjis/ci-phpunit-test/releases This includes BC break according to bug fix. * Now reset_instance() removes the existing CodeIgniter instance. * Now $this->getDouble() does not call the original constructor by default. The changes may break your test code. If so, please fix or update your tests. RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 12-03-2015 Here is the current specification of ci-phpunit-test for CodeIgniter Hooks: https://github.com/kenjis/ci-phpunit-test/blob/master/docs/HowToWriteTests.md#hooks If anyone has any opinion about it, please post to https://github.com/kenjis/ci-phpunit-test/issues/20 I think the current specification is good enough. So I'm planning to close the issue. RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 12-08-2015 Hi guys! Today ci-phpunit-test got 90 stars on GitHub. If you like it and don't mind, please star it on https://github.com/kenjis/ci-phpunit-test RE: ci-phpunit-test for CodeIgniter 3.0 - resolv_25 - 12-30-2015 Hi, I'm trying to use your this library, it works fine with controllers, I have a problem with model testing. As instructed in your guide, I extracted your library into application/tests I tried with my own model test, and then created test for your Category_model, also, the model with a proper method is created, as well as table in database. Your CategorySeeder successfully inserted data into database. Category_model_test.php is copy/paste as from example: PHP Code: class Category_model_test extends TestCase I've got the following error by PHPunit; Code: Fatal error: Call to a member function query() on null in /var/www/html/lipa2016/application/models/Category_model.php on line 11 return $this->db->query("SELECT * FROM category"); Category_model.php is this: PHP Code: <?php If I uncomment query like this: $this->db->order_by ( 'name', 'asc' ); return $this->db->get ('category'); I've got error from phpunit: Code: Severity: Error PHPUnit version is 5.1.3, PHP version is 5.6.14, The same error was with PHPUnit 4.8 and php 5.4. If you need more details about the code, please, let me know. Regards, RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 12-30-2015 @resolv_25 Tests run on `testing` environment. https://github.com/kenjis/ci-phpunit-test/blob/master/docs/HowToWriteTests.md#testing-environment Did you setup database.php for testing environment correctly? RE: ci-phpunit-test for CodeIgniter 3.0 - kenjis - 12-31-2015 I've just released v0.10.1: https://github.com/kenjis/ci-phpunit-test/releases It includes only small bug fixes. |