Git Product home page Git Product logo

Comments (10)

RodolfoSilva avatar RodolfoSilva commented on May 25, 2024

Example, please.

from ci-phpunit-test.

felipe86hs avatar felipe86hs commented on May 25, 2024

Hi, in the terminal I did:

$ cd application/tests
$ ../../vendor/bin/phpunit --debug

And the result was the same as my original post.

from ci-phpunit-test.

rochefort avatar rochefort commented on May 25, 2024

Hi, felipe86hs.

What is the version of CodeIgniter?
Is it version 2?

Now I have no problem as follows.
PHP 5.6.10
CodeIgniter 3.0

from ci-phpunit-test.

felipe86hs avatar felipe86hs commented on May 25, 2024

Hi rochefot, im using CI version 3.
and I update php to 5.6.10.
I don't understand why i can't use this normally

from ci-phpunit-test.

RodolfoSilva avatar RodolfoSilva commented on May 25, 2024

CodeIgniter is not 3.0

PHP Fatal error: Call to a member function item() on null in /system/core/Utf8.php on line 48
PHP Stack trace:

CI 3: Utf8.php on line 48
https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Utf8.php#L48

CI 2: Utf8.php on line 48
https://github.com/bcit-ci/CodeIgniter/blob/2.2.3/system/core/Utf8.php#L48

from ci-phpunit-test.

felipe86hs avatar felipe86hs commented on May 25, 2024

Damn! wrong project... I'm sorry, now I installed in the correct project but now I got this error:

felipe@Lenovo-Y50-70:/application/tests$ ../../vendor/bin/phpunit --debug

A PHP Error was encountered

Severity: NoticeMessage:  Constant MODPATH already definedFilename: /application/core/MY_Router.phpLine Number: 95

Backtrace:




    File: /application/core/MY_Router.php Line: 95    Function: define


    File: /application/core/MY_Router.php Line: 24    Function: _set_routing


    File: /application/tests/_ci_phpunit_test/replacing/core/Common.php   Line: 98    Function: __construct


    File: /application/tests/_ci_phpunit_test/functions.php   Line: 37    Function: load_class


    File: /application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php    Line: 89    Function: reset_instance


    File: /application/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php    Line: 41    Function: callControllerMethod


    File: /application/tests/_ci_phpunit_test/CIPHPUnitTestCase.php   Line: 54    Function: request


    File: /application/tests/controllers/Welcome_test.php Line: 15    Function: request



    File: /vendor/phpunit/phpunit/src/Framework/TestCase.php  Line: 881   Function: invokeArgs


    File: /vendor/phpunit/phpunit/src/Framework/TestCase.php  Line: 746   Function: runTest


    File: /vendor/phpunit/phpunit/src/Framework/TestResult.php    Line: 601   Function: runBare


    File: /vendor/phpunit/phpunit/src/Framework/TestCase.php  Line: 702   Function: run


    File: /vendor/phpunit/phpunit/src/Framework/TestSuite.php Line: 738   Function: run


    File: /vendor/phpunit/phpunit/src/Framework/TestSuite.php Line: 738   Function: run


    File: /vendor/phpunit/phpunit/src/TextUI/TestRunner.php   Line: 428   Function: run


    File: /vendor/phpunit/phpunit/src/TextUI/Command.php  Line: 147   Function: doRun


    File: /vendor/phpunit/phpunit/src/TextUI/Command.php  Line: 99    Function: run


    File: /vendor/phpunit/phpunit/phpunit Line: 36    Function: main

from ci-phpunit-test.

RodolfoSilva avatar RodolfoSilva commented on May 25, 2024

Update MY_Route to CI 3.0

from ci-phpunit-test.

felipe86hs avatar felipe86hs commented on May 25, 2024

Hi! and thanks to everybody, I found the mistake, it was my fault. Sorry

from ci-phpunit-test.

kenjis avatar kenjis commented on May 25, 2024

No problem. What's your mistake?

from ci-phpunit-test.

2n2n avatar 2n2n commented on May 25, 2024

for those who had still the same problem.. for codeigniter 2
http://www.cuelogic.com/blog/getting-started-with-phpunit-codeigniter/

  1. and the assignment of
    $this->CI =& get_instance
    should be inside the setUp() function of the test file.
  2. Open up the system/core/Utf8.php file and goto line 41, the $CFG variable is marked as global and this is causing issues with PHPUnit. Replace that line by loading the class via CodeIgniter like so:
    $CFG =& load_class('Config', 'core');

from ci-phpunit-test.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.