While I'm trying to run unit/functional/acceptance test i'm getting DEPRECATION message
Provide console output if related. Use
-vvvmode for more details.
19x DEPRECATION: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead. /Users/Projects/bits/budget/testtest/vendor/symfony/event-dispatcher/EventDispatcher.php:58
DEPRECATION: The "Symfony\Component\HttpKernel\Client" class is deprecated since Symfony 4.3, use "Symfony\Component\HttpKernel\HttpKernelBrowser" instead. /Users/Projects/bits/budget/testtest/vendor/symfony/http-kernel/Client.php:14
4x DEPRECATION: The "Symfony\Component\BrowserKit\Response::getStatus()" method is deprecated since Symfony 4.3, use getStatusCode() instead. /Users/Projects/bits/budget/testtest/vendor/symfony/browser-kit/Response.php:100
Provide test source code if related
// paste test
composer show)behat/gherkin v4.6.0 Gherkin DSL parser for PHP 5.3
codeception/codeception 3.0.1 BDD-style testing framework
codeception/phpunit-wrapper 8.0.4 PHPUnit classes used by Codeception
codeception/stub 2.1.0 Flexible Stub wrapper for PHPUnit's Mock Builder
doctrine/annotations v1.6.1 Docblock Annotations Parser
doctrine/cache v1.8.0 Caching library offering an object-oriented API for many cache backends
doctrine/collections v1.6.1 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common v2.10.0 PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as b...
doctrine/dbal v2.9.2 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/doctrine-bundle 1.11.1 Symfony DoctrineBundle
doctrine/doctrine-cache-bundle 1.3.5 Symfony Bundle for Doctrine Cache
doctrine/doctrine-migrations-bundle v2.0.0 Symfony DoctrineMigrationsBundle
doctrine/event-manager v1.0.0 Doctrine Event Manager component
doctrine/inflector v1.3.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.2.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations v2.0.2 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning yo...
doctrine/orm v2.6.3 Object-Relational-Mapper for PHP
doctrine/persistence 1.1.1 The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/reflection v1.0.0 Doctrine Reflection component
easycorp/easy-log-handler v1.0.7 A handler for Monolog that optimizes log messages to be processed by humans instead of software. Improve your productivity with ...
egulias/email-validator 2.1.8 A library for validating emails against several RFCs
facebook/webdriver 1.6.0 A PHP client for Selenium WebDriver
fig/link-util 1.0.0 Common utility implementations for HTTP links
guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.5.2 PSR-7 message implementation that also provides common utility methods
hoa/consistency 1.17.05.02 The Hoa\Consistency library.
hoa/console 3.17.05.02 The Hoa\Console library.
hoa/event 1.17.01.13 The Hoa\Event library.
hoa/exception 1.17.01.16 The Hoa\Exception library.
hoa/file 1.17.07.11 The Hoa\File library.
hoa/iterator 2.17.01.10 The Hoa\Iterator library.
hoa/protocol 1.17.01.14 The Hoa\Protocol library.
hoa/stream 1.17.02.21 The Hoa\Stream library.
hoa/ustring 4.17.01.16 The Hoa\Ustring library.
jdorn/sql-formatter v1.2.17 a PHP SQL highlighting library
monolog/monolog 1.24.0 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.9.1 Create deep copies (clones) of your objects
nikic/php-parser v4.2.2 A PHP parser written in PHP
ocramius/package-versions 1.4.0 Composer plugin that provides efficient querying for installed package versions (no runtime IO)
ocramius/proxy-manager 2.2.2 A library providing utilities to generate, instantiate and generally operate with Object Proxies
phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 2.0.1 Library for handling version information and constraints
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 4.3.1 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embed...
phpdocumentor/type-resolver 0.4.0
phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 7.0.4 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 2.0.2 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 2.1.1 Utility class for timing
phpunit/php-token-stream 3.0.1 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 8.1.6 The PHP Unit Testing framework.
psr/cache 1.0.1 Common interface for caching libraries
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/http-message 1.0.1 Common interface for HTTP messages
psr/link 1.0.0 Common interfaces for HTTP links
psr/log 1.1.0 Common interface for logging libraries
ralouphie/getallheaders 2.0.5 A polyfill for getallheaders.
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
sebastian/diff 3.0.2 Diff implementation
sebastian/environment 4.2.2 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 3.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 2.0.1 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
sensio/framework-extra-bundle v5.3.1 This bundle provides a way to configure your controllers with annotations
swiftmailer/swiftmailer v6.2.1 Swiftmailer, free feature-rich PHP mailer
symfony/asset v4.3.0 Symfony Asset Component
symfony/browser-kit v4.3.0 Symfony BrowserKit Component
symfony/cache v4.3.0 Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts v1.1.1 Generic abstractions related to caching
symfony/config v4.3.0 Symfony Config Component
symfony/console v4.3.0 Symfony Console Component
symfony/css-selector v4.3.0 Symfony CssSelector Component
symfony/debug v4.3.0 Symfony Debug Component
symfony/debug-bundle v4.3.0 Symfony DebugBundle
symfony/debug-pack v1.0.7 A debug pack for Symfony projects
symfony/dependency-injection v4.3.0 Symfony DependencyInjection Component
symfony/doctrine-bridge v4.3.0 Symfony Doctrine Bridge
symfony/dom-crawler v4.3.0 Symfony DomCrawler Component
symfony/dotenv v4.3.0 Registers environment variables from a .env file
symfony/event-dispatcher v4.3.0 Symfony EventDispatcher Component
symfony/event-dispatcher-contracts v1.1.1 Generic abstractions related to dispatching event
symfony/expression-language v4.3.0 Symfony ExpressionLanguage Component
symfony/filesystem v4.3.0 Symfony Filesystem Component
symfony/finder v4.3.0 Symfony Finder Component
symfony/flex v1.2.5 Composer plugin for Symfony
symfony/form v4.3.0 Symfony Form Component
symfony/framework-bundle v4.3.0 Symfony FrameworkBundle
symfony/http-client v4.3.0 Symfony HttpClient component
symfony/http-client-contracts v1.1.1 Generic abstractions related to HTTP clients
symfony/http-foundation v4.3.0 Symfony HttpFoundation Component
symfony/http-kernel v4.3.0 Symfony HttpKernel Component
symfony/inflector v4.3.0 Symfony Inflector Component
symfony/intl v4.3.0 A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/maker-bundle v1.11.6 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerp...
symfony/mime v4.3.0 A library to manipulate MIME messages
symfony/monolog-bridge v4.3.0 Symfony Monolog Bridge
symfony/monolog-bundle v3.3.1 Symfony MonologBundle
symfony/options-resolver v4.3.0 Symfony OptionsResolver Component
symfony/orm-pack v1.0.6 A pack for the Doctrine ORM
symfony/polyfill-intl-icu v1.11.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn v1.11.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring v1.11.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.11.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73 v1.11.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/process v4.3.0 Symfony Process Component
symfony/profiler-pack v1.0.4 A pack for the Symfony web profiler
symfony/property-access v4.3.0 Symfony PropertyAccess Component
symfony/property-info v4.3.0 Symfony Property Info Component
symfony/routing v4.3.0 Symfony Routing Component
symfony/security-bundle v4.3.0 Symfony SecurityBundle
symfony/security-core v4.3.0 Symfony Security Component - Core Library
symfony/security-csrf v4.3.0 Symfony Security Component - CSRF Library
symfony/security-guard v4.3.0 Symfony Security Component - Guard
symfony/security-http v4.3.0 Symfony Security Component - HTTP Integration
symfony/serializer v4.3.0 Symfony Serializer Component
symfony/serializer-pack v1.0.2 A pack for the Symfony serializer
symfony/service-contracts v1.1.2 Generic abstractions related to writing services
symfony/stopwatch v4.3.0 Symfony Stopwatch Component
symfony/swiftmailer-bundle v3.2.7 Symfony SwiftmailerBundle
symfony/translation v4.3.0 Symfony Translation Component
symfony/translation-contracts v1.1.2 Generic abstractions related to translation
symfony/twig-bridge v4.3.0 Symfony Twig Bridge
symfony/twig-bundle v4.3.0 Symfony TwigBundle
symfony/validator v4.3.0 Symfony Validator Component
symfony/var-dumper v4.3.0 Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter v4.3.0 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
symfony/web-link v4.3.0 Symfony WebLink Component
symfony/web-profiler-bundle v4.3.0 Symfony WebProfilerBundle
symfony/web-server-bundle v4.3.0 Symfony WebServerBundle
symfony/yaml v4.3.0 Symfony Yaml Component
theseer/tokenizer 1.1.2 A small library for converting tokenized PHP source code into XML and potentially other formats
twig/twig v2.11.0 Twig, the flexible, fast, and secure template language for PHP
webmozart/assert 1.4.0 Assertions to validate method input/output with nice error messages.
zendframework/zend-code 3.3.1 provides facilities to generate arbitrary code using an object oriented interface
zendframework/zend-eventmanager 3.2.1 Trigger and listen to events within a PHP application
class_name: ApiTester
modules:
enabled:
- Symfony:
app_path: 'src'
environment: 'test'
- REST:
url: /
depends: Symfony
- \App\Tests\Helper\Api
Symfony, Laravel and Lumen modules extend deprecated \Symfony\Component\HttpKernel\Client class.
@DavertMik I think that we have 2 options here:
a) create codeception/symfony-wrapper similar to phpunit-wrapper or
b) drop support for PHP <7.1.3 and Symfony < 4.3 in the next major release.
Yeah, I'd rather to go for b)
Maintaining compatiblity layer is a disaster.
@Naktibalda, @DavertMik tell me pls, when is the next release planned?
@matvey88 Honest answer is that it isn't, but we usually do them about once a month.
If there is no release in 2 weeks time, please ping me.
@DavertMik an additional benefit of raising the bar that high will be that we will be able to raise minimum supported version of PHPUnit to 7.5 in time for release of PHPUnit 9.
I'm receiving this warning using Phalcon Framework.
You may try to pass an env variable SYMFONY_DEPRECATIONS_HELPER=weak, at least it allows CodeCeption to send exit code 0
Related ticket #5353
@Naktibalda Hi! I've encountered the same error on Codeception 3.0.1, simple clean project with only one test which does HTTP GET ends up with:
Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead
Do you have any update on this situation?
Funny enough, the official Symfony documentation gives the exact same example of dispatching the event like so:
$dispatcher->dispatch(OrderPlacedEvent::NAME, $event);
for Symfony 3.4, 4.3, 4.4, while latest sources are clearly stating the method with the exact opposite parameters order:
public function dispatch($event, string $eventName = null): object
@dbek deprecation message will be suppressed by #5555
Symfony 5 support will be implemented in Codeception 4.
The question here is not the next major version of Symfony, is the usage of https://github.com/php-fig/event-dispatcher
Well, we couldn't care less about PSR-14.
The only reason for us to make this change is to be able to support Symfony 5 when it comes out, so there is no need to rush.
For the end-user is complicated because the patch did not fix the errors. I'm receiving a lot of deprecation errors I think are triggered before ErrorHandler is registered.
Caused by symfony/event-dispatcher > 4.2.8
Hello!
Yii2
In EventDispatcher.php line 58:
Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.
how to fix??? Please!
Caused by
symfony/event-dispatcher > 4.2.8
As a workaround you can pin this version.
Hello, DanielRuf!
Yii , symfony/event-dispatcher < 4.2.8, mistake In EventDispatcher.php line 58 fixed, but a new error appears:
In Client.php line 219: Calling the "Codeception\Lib\Connector\Yii2::getInternalResponse()" method before the "request()" one is deprecated since Symfony 4.1 and will throw an exception in 5.0.
how to fix??? Please!
I pinned it to .8. Not sure, you would have to share a sample project with us which causes this.
This message is emitted by symfony/browser-kit
Hello! Yii, works test if in composer.json
"codeception/codeception": "^3.1.0",
"phpunit/phpunit": "~6.5.5",
"codeception/verify": "~1.1.0",
"symfony/event-dispatcher":"< 4.2.8",
"symfony/browser-kit": ">=2.7 < 4.1.0"
But another error occurs, session_set_cookie_params(): Cannot change session cookie parameters when headers already sent maybe she is connected Yii or phpstorm...
Hello! I fixed this error. This error is resolved, relates to phpstorm. Thanks everyone! Yii tests works!
Hello! I fixed this error. This error is resolved, relates to phpstorm. Thanks everyone! Yii tests works!
I meet the same question too ! Can you tell me how can I fixed it?
Hello! cmzthd!
for Yii-advanched
vendor\phpunit\phpunitsrc\Util\Printer.php
+++ if (!$out) $out = 'php://stderr'; === solution from the internet
if ($out !== null) {
Thanks everyone!
you have also option
c) allow to inject and reconfigure event dispatcher for such cases. in this case all could create his own wrapper and inject into CodeCeption as dispatcher. (class_overrides: Symfony\Component\EventDispatcher\EventDispatcherInterface: MyCoolWrappedClass)
cool things that it will provide (I think there is tons of people who wrote his wrapper for EventDispatcher) and you do not use it, you use raw symfony EventDispatcher. in this case all people who likes creating bicycles, will suffer hardly.
(this could be added by ContainerInterface to but still there can be added option to override default classes.)
@DavertMik
Yeah, I'd rather to go for b)
Maintaining compatiblity layer is a disaster.
of course i understand that maintaining compat layers is very painful but dropping symfony 3.4 support is a very bad idea.
symfony 3.4 is a LTS release. it is supported until nov 2020 and gets security updates until nov 2021.
it was my choice to stick with this version so i can use my time to build new things and not keeping all my projects up to date. i assume that also some companies go for LTS releases, they also want to invest their workers time into new projects instead in keeping all project up to date with the latest framework version.
in the past years the "version rush" gets more and more terrible. i am not a big company, i am a one person company and really struggle to keep everything up to date.
today an update is not "i make a security update and my lib, app, tool, ... is secure again and i can move on", no its you get an update with your necessary secuirity updates AND you get tons of new features and you also loose a lot of features. features you need, featrues you build upon. also many updates breaks things. a lot of people out there even don't use SemVer (or they use SemVer but like google does it for chrome).
i often discuss with user why they don't update ....... (insert software/lib/app/... here) and that it is very important to update,.... but a user only want that the thing works (what it does without update) without much effort, without getting used to the new interface, without searching for the new locations for the functions and menu items. i tell them, that its very important to update... security...
but i can understand them.
without good SemVer, LTS and BC layer we all get to tired to update.
Rasmus Lerdorf asking his audience who is using php 5.x (watch at least min 26:08-26:45)
https://www.youtube.com/watch?v=wCZ5TJCBWMg&t=1568
but thats reality.
so please add a BC layer so that we can test our new and old application with your awesome testframework.
@c33s If you don't want to update Symfony, why do you insist on using the latest version of Codeception and PHPUnit? Just continue using the last version of Codeception which supported Symfony 3.4
In other news, I started separating Codeception core from modules, so it will be a bit easier to maintain 2 versions of core - one for Symfony 4.3+ and another for Symfony 2.7 - 4.2
@Naktibalda in this case i think the test framework should be compatible with all active versions of symfony. simply to have all the new features you integrate in codeception.
separating core from modules sounds awesome.
Did version 4 fix this?
No, it will be fixed in version 5.
Both versions will be maintained.
@Naktibalda
The only reason for us to make this change is to be able to support Symfony 5 when it comes out, so there is no need to rush.
Symfony 5 is out now. You may want to start rushing. ;)
Most helpful comment
Yeah, I'd rather to go for b)
Maintaining compatiblity layer is a disaster.