Issue while running phpunit in codeigniter |
-
Rekha
Newbie
-
Posts: 1
Threads: 1
Joined: Mar 2019
Reputation:
0
Hi,
I am new to PHPUnit tests for CodeIgniter application. I have installed ci-phpunit-test(with reference from https://github.com/kenjis/ci-phpunit-test) in my CI application and tried to run it with Welcome Test case. Then I got some errors. I am not sure whether I missed any configuration. Please find the issues below,
- Undefined index: scheme in DB.php line number 121. Then, I statically gave mysqli instead of $dns['scheme'] to check further.
- After 1, got an error such Error: Call to a member function close() on string in the file mysqli_driver line number 541. Then I commented this line and executed the phpunit. Welcome controller got tested successfully.
- So, I thought to test the model and then I wrote a test and executed. The error is Error: Call to a member function result() on null. Model Code below,
$this->db->select('name,value'); $query = $this->db->get('config'); $configData=$query->result();
I tried to fix it by myself but I couldn't. Please help me to fix these errors.
|