Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI_URI::__construct() must be instance of CI_Config #116

Closed
rslhdyt opened this issue May 2, 2016 · 6 comments
Closed

CI_URI::__construct() must be instance of CI_Config #116

rslhdyt opened this issue May 2, 2016 · 6 comments

Comments

@rslhdyt
Copy link

rslhdyt commented May 2, 2016

Help, i got this error when running phpunit 4.7.6

A PHP Error was encountered

Severity: 4096
Message: Argument 1 passed to CI_URI::__construct() must be an instance of CI_Config, none given, called in /(PATH)/application/tests/_ci_phpunit_test/replacing/core/Common.php on line 111 and defined
Filename: /(PATH)/system/core/URI.php
Line Number: 99

@tangix
Copy link

tangix commented May 2, 2016

If you are including your own configuration file, make sure a proper $config is set for ENVIRONMENT = "testing"
I stumbled on this because the testing sets ENVIRONMENT = "testing" and I only checked for "production" or "development"

@rslhdyt
Copy link
Author

rslhdyt commented May 2, 2016

@tangix I've configuration files corectly in application/config/testing/config.php and ENVIRONMENT set to 'testing' but still got error :(

@tangix
Copy link

tangix commented May 2, 2016

And you are 100% sure all config files sets $config when in testing?

@ytetsuro
Copy link
Contributor

ytetsuro commented May 2, 2016

please typing command in CodeIgniter directory

git checkout remotes/origin/3.0-stable

@kenjis
Copy link
Owner

kenjis commented May 2, 2016

CI_URI::__construct() in 3.0 has no params: https://github.com/bcit-ci/CodeIgniter/blob/3.0-stable/system/core/URI.php#L99
But 3.1.0-dev has a param: https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/URI.php#L99

Do you really want to use CodeIgniter 3.1.0-dev (develop branch)?
If so, at least you should update CodeIgniter.php: bcit-ci/CodeIgniter@2a34081

ci-phpunit-test does not support 3.1.0-dev now.

@rslhdyt
Copy link
Author

rslhdyt commented May 3, 2016

I don't realize my codeigniter version, now the phpunit test is working. Thanks for you all.

hiyao added a commit to hiyao/ci-phpunit-test that referenced this issue Oct 5, 2016
@kenjis kenjis closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants