You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using CI 3.1.13, PHP 7.4, PHPUnit 9.6, ci-phpunit-test freshly installed.
I have read this Issue 242 and it seems related, but cannot figure out the solution.
When I load my ts_helper via config/autoloader I get:
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.
Warning: No code coverage driver available
.E........... 13 / 13 (100%)
Time: 00:00.309, Memory: 10.00 MB
There was 1 error:
Main_test::test_index
RuntimeException: Cannot modify header information - headers already sent by (output started at /web/app-v1/helpers/ts_helper.php:1) on line 63 in file /web/app-v1/tests/_ci_phpunit_test/replacing/helpers/url_helper.php
I have commented everything in the ts_helper and the error continues.
Another point that may pertain to this is I am running the tests with ENVIRONMENT = 'development' as my intent is to use the test first coding method.
Changing url_helper line 61 to if( ! (ENVIRONMENT == 'testing' || ENVIRONMENT == 'development')) causes all the tests to be skipped apparently as no dots, or other responses are displayed.
Changing ENVIRONMENT = 'testing' does seem to correct the issue. Test run and the error is shown. Not sure of the implications of developing in 'test' vs 'development' will be.
The link for phpunit.readthedocs.io about @runTestsInSeparateProcesses and @runInSeparateProcess in the comments leads to a 404.
The function CIPPUnitTestCase::isTestingEnv() line 469 added really didn't change the functionality of the original poster's issues and still only looks for testing. Possible change this to !== 'production'?
With the ENVIRONMENT back to 'development' and uncommenting everything in ts_helper, that change seems to fix the issue I am seeing.
Hope this helps someone.
The text was updated successfully, but these errors were encountered:
Using CI 3.1.13, PHP 7.4, PHPUnit 9.6, ci-phpunit-test freshly installed.
I have read this Issue 242 and it seems related, but cannot figure out the solution.
When I load my ts_helper via config/autoloader I get:
PHPUnit 9.6.22 by Sebastian Bergmann and contributors.
Warning: No code coverage driver available
.E........... 13 / 13 (100%)
Time: 00:00.309, Memory: 10.00 MB
There was 1 error:
RuntimeException: Cannot modify header information - headers already sent by (output started at /web/app-v1/helpers/ts_helper.php:1) on line 63 in file /web/app-v1/tests/_ci_phpunit_test/replacing/helpers/url_helper.php
/web/app-v1/tests/_ci_phpunit_test/CIPHPUnitTestCase.php:180
/web/app-v1/tests/_ci_phpunit_test/replacing/helpers/url_helper.php:63
/web/app-v1/controllers/Main.php:18
/web/app-v1/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php:373
/web/app-v1/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php:297
/web/app-v1/tests/_ci_phpunit_test/CIPHPUnitTestRequest.php:160
/web/app-v1/tests/_ci_phpunit_test/CIPHPUnitTestCase.php:155
/web/app-v1/tests/controllers/Main_test.php:21
The Main/index only redirects to Main/login
I have commented everything in the ts_helper and the error continues.
Another point that may pertain to this is I am running the tests with ENVIRONMENT = 'development' as my intent is to use the test first coding method.
Changing url_helper line 61 to if( ! (ENVIRONMENT == 'testing' || ENVIRONMENT == 'development')) causes all the tests to be skipped apparently as no dots, or other responses are displayed.
Changing ENVIRONMENT = 'testing' does seem to correct the issue. Test run and the error is shown. Not sure of the implications of developing in 'test' vs 'development' will be.
The link for phpunit.readthedocs.io about @runTestsInSeparateProcesses and @runInSeparateProcess in the comments leads to a 404.
The function CIPPUnitTestCase::isTestingEnv() line 469 added really didn't change the functionality of the original poster's issues and still only looks for testing. Possible change this to !== 'production'?
With the ENVIRONMENT back to 'development' and uncommenting everything in ts_helper, that change seems to fix the issue I am seeing.
Hope this helps someone.
The text was updated successfully, but these errors were encountered: