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

Class 'CodeIgniter\Test\CIUnitTestCase' not found when testing in Appstarter project #1864

Closed
diegoldev opened this issue Mar 23, 2019 · 4 comments

Comments

@diegoldev
Copy link
Contributor

diegoldev commented Mar 23, 2019

Describe the bug
When trying to run tests CIUnitTestCase is not found
I think that is related to namespace of class inside _support folder, but not sure.

CodeIgniter 4 version
Codeigniter4-beta-0.0.1

Affected module(s)
Testing module

Expected behavior, and steps to reproduce if appropriate

  1. I've installed Codeigniter as appstarter project via composer.
  2. I've created 'tests' folder at project root
  3. I've move '_support' folder insider 'tests' one created at step 2
  4. I've creater '/tests/TestFoo.php' class as described in documentation
  5. When I run 'phpunit' command it's throwing the follow error:
    PHP Fatal error: Uncaught Error: Class 'CIUnitTestCase' not found in /var/www/html/rrhh/tests/TestFoo.php:3 Stack trace: #0 phar:///usr/local/bin/phpunit/phpunit/Util/FileLoader.php(59): include_once() #1 phar:///usr/local/bin/phpunit/phpunit/Util/FileLoader.php(47): PHPUnit\Util\FileLoader::load('/var/www/html/r...') #2 phar:///usr/local/bin/phpunit/phpunit/Runner/StandardTestSuiteLoader.php(40): PHPUnit\Util\FileLoader::checkAndLoad('/var/www/html/r...') #3 phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php(131): PHPUnit\Runner\StandardTestSuiteLoader->load('TestFoo', '/var/www/html/r...') #4 phar:///usr/local/bin/phpunit/phpunit/Runner/BaseTestRunner.php(78): PHPUnit\Runner\BaseTestRunner->loadSuiteClass('TestFoo', '/var/www/html/r...') #5 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(185): PHPUnit\Runner\BaseTestRunner->getTest('TestFoo', '/var/www/html/r...', Array) #6 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(164): PHPUnit\TextUI\Command->run(Array, true) #7 /usr/local/bin/phpunit( in /var/www/html/rrhh/tests/TestFoo.php on line 3

Context

  • OS: [Debian 9 running on Docker container - host: Windows 10]
  • Web server [Apache 2.4]
  • PHP version [7.3]
  • MySQL [5.7]
@diegoldev diegoldev changed the title Class 'CodeIgniter\Test\CIUnitTestCase' not found when testing Appstarter Class 'CodeIgniter\Test\CIUnitTestCase' not found when testing in Appstarter Mar 23, 2019
@diegoldev diegoldev changed the title Class 'CodeIgniter\Test\CIUnitTestCase' not found when testing in Appstarter Class 'CodeIgniter\Test\CIUnitTestCase' not found when testing in Appstarter project Mar 23, 2019
@jim-parry
Copy link
Contributor

I think this was reported earlier, and fixed in what will be the next beta. Will check

@diegoldev
Copy link
Contributor Author

May be that was related with #1710 ?

@jim-parry
Copy link
Contributor

That is correct :)
I believe that I have fixed the fodler problem, and that should be reflected in the current "develop" branch.
I am not convinced that I have solved the other aspect, namely the testing.

@jim-parry jim-parry added this to the 4.0.0-beta.3 milestone Mar 25, 2019
@jim-parry
Copy link
Contributor

Treating this as a duplicate, then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants