Posts: 251
Threads: 151
Joined: Sep 2014
Reputation:
97
<<From Orionstar>>
CI should encourage application tests. To make the life of the devs easier CI should provide mocks for the system files and an easy way to create application tests with PHPUnit and these should be bundled into the downloadable versions.
James Parry
Project Lead
Posts: 16
Threads: 2
Joined: Jan 2015
Reputation:
0
yes, mock system must be created so we can test our code easily..
Posts: 476
Threads: 18
Joined: Oct 2014
Reputation:
18
For example, `rediret()` in URL helper calls `exit()`. So we can't test code using `redirect()`. It stops phpunit itself.
To solve this problem, when we provide a mock for it, what shall we do `MY_url_helper.php`?
As you know if user has `MY_url_helper.php`, `redirect()` in `MY_url_helper.php` is used.
If we override `redirect()` in `MY_url_helper.php`, the changes he/she made is gone.
If `MY_url_helper.php` overrides the mock, phpunit stops with `exit()`.
This an example of `exit()` problem. I don't know how to solve it.
Any idea?
Posts: 671
Threads: 17
Joined: Oct 2014
Reputation:
37
@kenjis
What kind of result do you expect to be returned from a controller? Even there is no the so-called 'exit' problem, what is the common way to check whether a controller passes the test?
An ordinary controller method that simply shows a page simply puts something within the output buffer and then returns NULL. What is to be checked here?