Welcome Guest, Not a member yet? Register   Sign In
SimpleTester 1.0 - CI-library for unit testing
#23

[eluser]aspir[/eluser]
I've been using SimpleTester with my in-development CI app for a month or two now and I find that it's very helpful. That being said, I can't seem to find a way to deal with a situation such as this:

I'm unit testing Object A. Object A makes use of a model (and loads it using $this->load->model()). That model accesses the database and I don't want it to during test. Can I somehow make it so CI's load->model() method returns my mock implementation during testing? I'm not quite sure how to attack this short of including and instantiating my models without the CI methods. Any ideas?


Messages In This Thread
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-23-2007, 05:23 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-25-2007, 06:24 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-25-2007, 09:36 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-26-2007, 07:07 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-26-2007, 11:25 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-12-2008, 05:19 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-13-2008, 03:59 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-13-2008, 08:27 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-13-2008, 08:37 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-13-2008, 08:47 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-27-2008, 04:15 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-27-2008, 06:02 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 03-14-2008, 09:58 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 03-18-2008, 07:55 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 05-13-2008, 10:56 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 11-23-2008, 06:19 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 11-23-2008, 11:30 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-14-2008, 01:18 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 12-14-2008, 03:47 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-10-2009, 01:42 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-10-2009, 02:25 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-12-2009, 08:48 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-20-2009, 03:56 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 02-23-2009, 11:16 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 03-21-2009, 08:04 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 05-10-2009, 01:56 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 06-06-2010, 11:49 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 06-30-2010, 07:50 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 07-26-2010, 10:38 PM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 08-01-2010, 11:58 AM
SimpleTester 1.0 - CI-library for unit testing - by El Forum - 08-01-2010, 12:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB