{"action":"created","issue":{"url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/37","labels_url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/37/comments","events_url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/37/events","html_url":"https://github.com/fmalk/codeigniter-phpunit/issues/37","id":115464535,"number":37,"title":"testing libraries","user":{"login":"stephane-wis","id":1465907,"avatar_url":"https://avatars.githubusercontent.com/u/1465907?v=3","gravatar_id":"","url":"https://api.github.com/users/stephane-wis","html_url":"https://github.com/stephane-wis","followers_url":"https://api.github.com/users/stephane-wis/followers","following_url":"https://api.github.com/users/stephane-wis/following{/other_user}","gists_url":"https://api.github.com/users/stephane-wis/gists{/gist_id}","starred_url":"https://api.github.com/users/stephane-wis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephane-wis/subscriptions","organizations_url":"https://api.github.com/users/stephane-wis/orgs","repos_url":"https://api.github.com/users/stephane-wis/repos","events_url":"https://api.github.com/users/stephane-wis/events{/privacy}","received_events_url":"https://api.github.com/users/stephane-wis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-06T09:10:25Z","updated_at":"2015-11-06T17:18:07Z","closed_at":null,"body":"Hi,\r\nI have a Cockpit library in application/libraries.\r\nI'm using CI 3.0.2, a little modified by adding a public folder that contains the index.php, *.js, *.css, all images and other public resources. Path in the index.php have been changed accordingly.\r\nTest units were written for the models, and ran well until a library was added (without prefix). Running the web app is OK, running the phpunit gives an error about a missing CI_Cockpit (although the library is Cockpit). \r\nI tried with a prefix AQT_Cockpit, phpunit complains about a missing CI_AQT_Cockpit\r\nI tried with a suffix Cockpit_lib, phpunit complains about a missing CI_Cockpit_lib\r\nFinally, to continue working, I added (temporarily) at line 76 of system/core/Controller.php  \r\n`if (is_cli() && $class != 'Cockpit')`\r\nto escape the line \r\n`$this->$var =& load_class($class);`\r\nI hate to do this, but this can help you resolving/finding the problem. "},"comment":{"url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/comments/154476855","html_url":"https://github.com/fmalk/codeigniter-phpunit/issues/37#issuecomment-154476855","issue_url":"https://api.github.com/repos/fmalk/codeigniter-phpunit/issues/37","id":154476855,"user":{"login":"stephane-wis","id":1465907,"avatar_url":"https://avatars.githubusercontent.com/u/1465907?v=3","gravatar_id":"","url":"https://api.github.com/users/stephane-wis","html_url":"https://github.com/stephane-wis","followers_url":"https://api.github.com/users/stephane-wis/followers","following_url":"https://api.github.com/users/stephane-wis/following{/other_user}","gists_url":"https://api.github.com/users/stephane-wis/gists{/gist_id}","starred_url":"https://api.github.com/users/stephane-wis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephane-wis/subscriptions","organizations_url":"https://api.github.com/users/stephane-wis/orgs","repos_url":"https://api.github.com/users/stephane-wis/repos","events_url":"https://api.github.com/users/stephane-wis/events{/privacy}","received_events_url":"https://api.github.com/users/stephane-wis/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T17:18:07Z","updated_at":"2015-11-06T17:18:07Z","body":"I do not prefix my classes and the `load_class($class)` is CodeIgniter Framework code.\r\nIf I prefix the library e.g. MY_Cockpit then the Framework loads CI_MY_Cockpit.\r\nThis happens only when I run the `phpunit`, and never with I run the code from a browser."}}