ci-phpunit-test icon indicating copy to clipboard operation
ci-phpunit-test copied to clipboard

Fix CI_URI::__construct() add constructor args

Open hiyao opened this issue 9 years ago • 4 comments

See #116

hiyao avatar Oct 05 '16 22:10 hiyao

Coverage Status

Coverage remained the same at 72.956% when pulling 53c750bf4a8d358723fc16915b254990f180908d on hiyao:master into 3255d61ba1bc22e714ca4dbe32a2f5b210c92528 on kenjis:master.

coveralls avatar Oct 05 '16 22:10 coveralls

See https://github.com/bcit-ci/CodeIgniter/blob/3.1-stable/system/core/CodeIgniter.php#L301. There is no 3rd argument.

kenjis avatar Oct 06 '16 00:10 kenjis

I used the latest develop version of Codeigniter to run phpunit, then I found this issue.

An uncaught Exception was encountered

Type:        TypeError
Message:     Argument 1 passed to CI_URI::__construct() must be an instance of CI_Config, none given, called in /Users/hiyao/Documents/projects/ci/application/tests/_ci_phpunit_test/replacing/core/Common.php on line 111
Filename:    /Users/hiyao/Documents/projects/ci/system/core/URI.php
Line Number: 99

Backtrace:
    File: /Users/hiyao/Documents/projects/ci/application/tests/_ci_phpunit_test/replacing/core/Common.php
    Line: 111
    Function: __construct

    File: /Users/hiyao/Documents/projects/ci/application/tests/_ci_phpunit_test/replacing/core/CodeIgniter.php
    Line: 305
    Function: load_class

    File: /Users/hiyao/Documents/projects/ci/application/tests/_ci_phpunit_test/CIPHPUnitTest.php
    Line: 76
    Function: require

    File: /Users/hiyao/Documents/projects/ci/application/tests/Bootstrap.php
    Line: 361
    Function: init

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/Util/Fileloader.php
    Line: 56
    Function: include_once

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/Util/Fileloader.php
    Line: 38
    Function: load

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/TextUI/Command.php
    Line: 875
    Function: checkAndLoad

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/TextUI/Command.php
    Line: 704
    Function: handleBootstrap

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/TextUI/Command.php
    Line: 124
    Function: handleArguments

    File: phar:///Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar/phpunit/TextUI/Command.php
    Line: 113
    Function: run

    File: /Users/hiyao/dev_tools/phpunit-5.4/phpunit-5.4.2.phar
    Line: 528
    Function: main

So I try to fix this. :p

See https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/CodeIgniter.php#L301

hiyao avatar Oct 06 '16 03:10 hiyao

Thank you for your information. But I can't merge this PR until the developing CI is officially released.

See https://github.com/kenjis/ci-phpunit-test/tree/master/application/tests/_ci_phpunit_test/replacing/core. The current CodeIgniter.php is of the current official version.

kenjis avatar Oct 12 '16 22:10 kenjis