D
D
Dmitry2018-11-21 02:42:37
phpstorm
Dmitry, 2018-11-21 02:42:37

Warning when running tests, how to solve?

Goodnight.
Trying to set up codeception for YII2 testing.
I made the following settings in PhpStorm
5bf49a3150ded831484227.png5bf49a726e969323876144.png5bf49a9b347dc608130504.png5bf49ac4ebcb5814724259.png
When I run tests, I get a warning

Testing started at 1:11 ...
/usr/bin/php /tmp/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction -c /home/slonik/localhost/www/test.loc/yii2_test/codeception.yml
PHP Warning:  Declaration of PhpStorm_Codeception_ReportPrinter::writeProgress($progress): void should be compatible with PHPUnit\TextUI\ResultPrinter::writeProgress(string $progress): void in /tmp/ide-codeception_24_70.php on line 2
PHP Stack trace:
PHP   1. {main}() /tmp/ide-codeception.php:0
PHP   2. require_once() /tmp/ide-codeception.php:32
Codeception PHP Testing Framework v2.5.1
Powered by PHPUnit 7.3.5 by Sebastian Bergmann and contributors.
Running with seed:

If I run tests from the console with the command vendor/bin/codecept run, then everything works without this warning.
5bf49b2a48e0f113540800.png
How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Kryazhev, 2019-03-07
@slo_nik

This problem has been bugging me for a long time too. When I try to run any of the codeception tests (specifically for Yii2) using PHPStorm (jetBrains) built-in tools, I get the following message:
session_set_cookie_params(): Cannot change session cookie parameters when headers already sent
The solution is simple. You need to add ob_start(); in tests/_bootstrap.php Answered
in detail on Stackoverflow here: https://ru.stackoverflow.com/a/953532/241265

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question