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

[eluser]jalalski[/eluser]
Yes, compression is set to FALSE.

Thanks.
#22

[eluser]jalalski[/eluser]
The problem is that, basically, SimpleTester is calling the ob_start() family of functions. And CI tries to call them when it throws an exception or tries to set a session. I'm not sure how to resolve that. I'd be interested to hear if anyone is using SimpleTester (or any unit testing framework) with CI.
#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?
#24

[eluser]aspir[/eluser]
Nevermind. I just subclassed CI's Loader class and overrode model() with some extensions to the original implementation to get this to work.
#25

[eluser]geshan[/eluser]
If anyone can post a tutorial on how to use it to test user inputs or even controller functions, it would be helpful. I installed it and its shows 7 tests passed ok but I don't know how to write tests. what files to include etc. Would appreciate any kind of help. Thanks.
#26

[eluser]geshan[/eluser]
When I try to test a controller function that calls a model, and in case the model calls functions of the DB class like query, insert etc there is an error like below:
<code>
Fatal error: Call to a member function insert() on a non-object in CodeIgniter170\system\application\models\user_model.php on line 39
</code>

How do I test these things eliminating the errors?
#27

[eluser]Unknown[/eluser]
Hi all

I have followed the set up instructions. But the browser would crash whenever I attempt to load the "simpletester" library, either through the controller, model or autoload. Firefox error is "The connection was reset".

Please help
#28

[eluser]Unknown[/eluser]
Hi everyone,

I got the library from site and install, everything works fine, except by this warning:

Message: Missing argument 1 for SimpleTester::__construct(), called in /var/www/codeigniter/system/libraries/Loader.php on line 928 and defined

Filename: libraries/simpletester.php

Line Number: 35

i put a '= null' in simpletest constructor and this warning disapear.

But, now i don't know where put this tests and how access this. I need create a controller ? extends anyone TestController ? where display the messages ? where write and put the tests?

anyone help me ?

thanks
#29

[eluser]tunesmith[/eluser]
For those using webtester, the reason the server hangs is because going to the website tries to run the tests. So if you have a test go to the website, it'll try to run the tests, which will go to the website, which will try to run the tests - until eventually your web server will conk out from too many concurrent connections.

You either need a way to pass in a noautorun flag for the tests that request against the website, or you need to create a separate code igniter controller that will run the tests.
#30

[eluser]uptime[/eluser]
I think SimpleTest should test its own code. Did anyone notice how many E_STRICT warnings it gets?

They've fixed it in 1.1 Beta (I've tested the one in their SVN) but many things have failed, they've changed too much and didn't take care of backwards compatibility.

I know it's open source and free and I'm surely appreciate their work but I would much rather to start off with a project that's well-maintained and backwards-compatible.

Just my 2 cents.




Theme © iAndrew 2016 - Forum software by © MyBB