wp-phpunit / issues

Central issues repository for wp-phpunit
0 stars 0 forks source link

Warnings while running the tests - headers already sent and final private method #9

Closed jakubmikita closed 3 years ago

jakubmikita commented 3 years ago

I'm getting this while running the tests

> phpunit

Warning: Private methods cannot be final as they are never overridden by other classes in C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Configuration.php on line 176

Call Stack:
16835532296.3649     366008   1. {main}() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:0
16835532296.3649     374848   2. PHPUnit\TextUI\Command::main() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:53
16835532296.3649     374960   3. PHPUnit\TextUI\Command->run() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:148
16835532296.3649     374960   4. PHPUnit\TextUI\Command->handleArguments() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:159
16835532296.3649     376384   5. Composer\Autoload\ClassLoader->loadClass() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:770
16835532296.3649     376384   6. Composer\Autoload\includeFile() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\composer\ClassLoader.php:322

Installing...
Running as single site... To run multisite, use -c tests/phpunit/multisite.xml

Warning: Cannot modify header information - headers already sent by (output started at C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Configuration.php:176) in C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php on line 1296

Call Stack:
16835532296.3649     366008   1. {main}() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:0
16835532296.3649     374848   2. PHPUnit\TextUI\Command::main() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:53
16835532296.3649     374960   3. PHPUnit\TextUI\Command->run() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:148
16835532296.3649     374960   4. PHPUnit\TextUI\Command->handleArguments() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:159
16835532296.3649     450568   5. PHPUnit\TextUI\Command->handleBootstrap() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:788
16835532296.3649     450760   6. PHPUnit\Util\Fileloader::checkAndLoad() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:991
16835532296.3649     451240   7. PHPUnit\Util\Fileloader::load() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Fileloader.php:48
16835532296.3649     452112   8. include_once('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\bootstrap.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Fileloader.php:64
16835532296.3649     462488   9. require('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\wp-phpunit\wp-phpunit\includes\bootstrap.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\bootstrap.php:30
16835532296.3649     835408  10. require_once('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-settings.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\wp-phpunit\wp-phpunit\includes\bootstrap.php:191
16835532296.3649    3221568  11. do_action() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-settings.php:579
16835532296.3649    3221944  12. WP_Hook->do_action() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\plugin.php:484
16835532296.3649    3221944  13. WP_Hook->apply_filters() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\class-wp-hook.php:311
16835532296.3649    3389416  14. BracketSpace\Notification\Core\Cache->auto_cache_objects() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\class-wp-hook.php:285
16835532296.3649    3387944  15. wp_safe_redirect() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\src\classes\Core\Cache.php:69
16835532296.3649    3388008  16. wp_redirect() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php:1404
16835532296.3649    3388096  17. header() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php:1296

Warning: Cannot modify header information - headers already sent by (output started at C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Configuration.php:176) in C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php on line 1299

Call Stack:
16835532296.3649     366008   1. {main}() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:0
16835532296.3649     374848   2. PHPUnit\TextUI\Command::main() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\phpunit:53
16835532296.3649     374960   3. PHPUnit\TextUI\Command->run() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:148
16835532296.3649     374960   4. PHPUnit\TextUI\Command->handleArguments() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:159
16835532296.3649     450568   5. PHPUnit\TextUI\Command->handleBootstrap() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:788
16835532296.3649     450760   6. PHPUnit\Util\Fileloader::checkAndLoad() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\TextUI\Command.php:991
16835532296.3649     451240   7. PHPUnit\Util\Fileloader::load() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Fileloader.php:48
16835532296.3649     452112   8. include_once('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\bootstrap.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\phpunit\phpunit\src\Util\Fileloader.php:64
16835532296.3649     462488   9. require('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\wp-phpunit\wp-phpunit\includes\bootstrap.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\bootstrap.php:30
16835532296.3649     835408  10. require_once('C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-settings.php') C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\vendor\wp-phpunit\wp-phpunit\includes\bootstrap.php:191
16835532296.3649    3221568  11. do_action() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-settings.php:579
16835532296.3649    3221944  12. WP_Hook->do_action() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\plugin.php:484
16835532296.3649    3221944  13. WP_Hook->apply_filters() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\class-wp-hook.php:311
16835532296.3649    3389416  14. BracketSpace\Notification\Core\Cache->auto_cache_objects() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\class-wp-hook.php:285
16835532296.3649    3387944  15. wp_safe_redirect() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\src\classes\Core\Cache.php:69
16835532296.3649    3388008  16. wp_redirect() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php:1404
16835532296.3649    3388104  17. header() C:\Users\Kuba\www\BracketSpace\plugins\notification\app\public\wp-content\plugins\notification\tests\_wordpress\wp-includes\pluggable.php:1299

Not running ajax tests. To execute these, use --group ajax.
Not running ms-files tests. To execute these, use --group ms-files.
Not running external-http tests. To execute these, use --group external-http.
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

.........................................                         41 / 41 (100%)

Time: 5.24 seconds, Memory: 6.00MB

OK (41 tests, 93 assertions)
aaemnnosttv commented 3 years ago

I'm not sure where this warning comes from exactly but looks like maybe BracketSpace\Notification\Core\Cache->auto_cache_objects?

wp-phpunit does not add any methods though; it's almost entirely a subset of WordPress core (develop) so it's either a problem with your local environment/code or upstream.