{"action":"created","issue":{"url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/72","labels_url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/72/comments","events_url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/72/events","html_url":"https://github.com/kenjis/ci-phpunit-test/issues/72","id":112823533,"number":72,"title":"help wanted loading libraries in subdirectories for controller testing","user":{"login":"jkudebeh","id":4480099,"avatar_url":"https://avatars.githubusercontent.com/u/4480099?v=3","gravatar_id":"","url":"https://api.github.com/users/jkudebeh","html_url":"https://github.com/jkudebeh","followers_url":"https://api.github.com/users/jkudebeh/followers","following_url":"https://api.github.com/users/jkudebeh/following{/other_user}","gists_url":"https://api.github.com/users/jkudebeh/gists{/gist_id}","starred_url":"https://api.github.com/users/jkudebeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkudebeh/subscriptions","organizations_url":"https://api.github.com/users/jkudebeh/orgs","repos_url":"https://api.github.com/users/jkudebeh/repos","events_url":"https://api.github.com/users/jkudebeh/events{/privacy}","received_events_url":"https://api.github.com/users/jkudebeh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kenjis/ci-phpunit-test/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-10-22T15:04:43Z","updated_at":"2015-11-20T10:02:23Z","closed_at":null,"body":"HI,\r\n\r\nI'm having trouble getting a controller test to run.\r\n\r\nThe message is : \r\n> Unable to locate the specified class: Session.php\r\n \r\nThe line from my autoload.php is : \r\n~~~php\r\n $autoload['libraries'] = array('database', 'session',  'PERM/Perm_hrpws');\r\n ~~~\r\n\r\nThe Session library is in `\"system/libraries/Session/Session.php\"`\r\n\r\nI also had a use library at `\"application/libraries/PERM/Perm_ws.php\"`, If I comment out 'session' \r\nThe message is : \r\n> Unable to locate the specified class: Perm_ws.php\r\n\r\n If I comment both out I don't get the message above, but get the error:\r\n>   Fatal error: Call to a member function flashdata() on null\r\n   \r\nAny thoughts on what I'm doing wrong?\r\n\r\nI tried both v0.8.2 and 1.0x-dev builds\r\n\r\nthanks\r\nJim"},"comment":{"url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/comments/158344965","html_url":"https://github.com/kenjis/ci-phpunit-test/issues/72#issuecomment-158344965","issue_url":"https://api.github.com/repos/kenjis/ci-phpunit-test/issues/72","id":158344965,"user":{"login":"kenjis","id":87955,"avatar_url":"https://avatars.githubusercontent.com/u/87955?v=3","gravatar_id":"","url":"https://api.github.com/users/kenjis","html_url":"https://github.com/kenjis","followers_url":"https://api.github.com/users/kenjis/followers","following_url":"https://api.github.com/users/kenjis/following{/other_user}","gists_url":"https://api.github.com/users/kenjis/gists{/gist_id}","starred_url":"https://api.github.com/users/kenjis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kenjis/subscriptions","organizations_url":"https://api.github.com/users/kenjis/orgs","repos_url":"https://api.github.com/users/kenjis/repos","events_url":"https://api.github.com/users/kenjis/events{/privacy}","received_events_url":"https://api.github.com/users/kenjis/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T10:02:23Z","updated_at":"2015-11-20T10:02:23Z","body":"@DakuTree Thank you for your beedback!\r\n\r\nBasically, we can't use `$this->load` in `$this->request->setCallablePreConstructor()`, because the *CodeIgniter instance* which we test does not exist yet.\r\n\r\nBut in your case, when you create the mock object, the constructor of mocked `Ion_auth` class is executed and it calls `$this->load->model('ion_auth_model');` and it calls `$this->load->library('vendor/bcrypt',$params);`.\r\n\r\nIt causes `Unable to locate the specified class: Bcrypt.php` error, when you create the new controller (= *CodeIgniter instance*).\r\n\r\nThe `disableOriginalConstructor()` method disables the constructor call when you create the mock object.\r\n\r\nI'm going to merge the patch in the next release.\r\n"}}