Welcome Guest, Not a member yet? Register   Sign In
Mocking library in Codeigniter 3x with PHPUnit?
#1

Hello, I would like to know, how it is possible to mock a library and skip the method in a test?

For example, there is a library, where I call another library and it's method:

PHP Code:
$this->ci =& get_instance();
....
$this->ci->load->library('Some_Library');
$this->ci->some_library->some_method();
.... 

In a test, I want to skip running "$this->ci->some_library->some_method();".

Trying to achieve this on:
Codeigniter 3.0
PHPUnit version 4.6.10

I would appreciate your help!
Reply
#2

What do you want to test?
You can mock a library, so it does not matter what libraries the library uses inside.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB