Closed gstolarz-euvic closed 6 years ago
I do not understand what you are trying to report.
@sebastianbergmann
PHP Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in phar:///usr/local/bin/phpunit/sebastian-comparator/DOMNodeComparator.php on line 110
PHP 7.2
Please share the output of composer info | sort
.
colinmollenhour/modman 1.12 Module Manager
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
eloquent/composer-config-reader 2.1.0 A light-weight component for reading Composer configuration files.
eloquent/enumeration 5.1.1 An enumeration implementation for PHP.
firegento/logger 1.8.0 FireGento Logger is an advanced alternative to log messages and errors to multiple targets.
firegento/psr0autoloader 0.1.0 This extension adds a PSR-0 autoloader before the Varien autoloader
justinrainbow/json-schema 4.1.0 A library to validate a json schema.
league/flysystem 1.0.44 Filesystem abstraction: Many filesystems, one API.
league/flysystem-sftp 1.0.15 Flysystem adapter for SFTP
magento-hackathon/magento-composer-installer 3.1.2 Composer installer for Magento modules
myclabs/deep-copy 1.7.0 Create deep copies (clones) of your objects
phar-io/manifest 1.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 1.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.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver 0.4.0
phpseclib/phpseclib 2.0.11 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.
phpspec/prophecy 1.7.6 Highly opinionated mocking framework for PHP 5.3+
phpunit/dbunit 3.0.3 PHPUnit extension for database interaction testing
phpunit/php-code-coverage 5.3.2 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.5 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 1.1.4 Utility class for invoking callables with a timeout.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.9 Utility class for timing
phpunit/php-token-stream 2.0.2 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 6.5.8 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 5.0.6 Mock Object library for PHPUnit
piwik-mage/piwik-analytics 1.1.8 This is a GPL released Extension that allows you to get your Magento Ecommerce Transaction data in your Piwik install.
psr/log 1.0.2 Common interface for logging libraries
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 2.1.3 Provides the functionality to compare PHP values for equality
sebastian/diff 2.0.1 Diff implementation
sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 2.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 1.0.0 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
sentry/sentry 1.8.4 A PHP client for Sentry (http://getsentry.com)
symfony/console v3.4.8 Symfony Console Component
symfony/debug v3.4.8 Symfony Debug Component
symfony/polyfill-mbstring v1.7.0 Symfony polyfill for the Mbstring extension
symfony/yaml v3.4.8 Symfony Yaml Component
theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and potentially other formats
webmozart/assert 1.3.0 Assertions to validate method input/output with nice error messages.
Do you use ./vendor/bin/phpunit
to invoke PHPUnit or do you have a global installation that you invoke with just phpunit
?
No feedback, closing.
@sebastianbergmann Same issue here. I use the local PHPUnit to run the tests.
./vendor/bin/phpunit
PHPUnit 5.6.4 by Sebastian Bergmann and contributors.
.PHP Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /home/einenlum/Prog/php/RaphyMarkdownBundle/vendor/sebastian/comparator/src/DOMNodeComparator.php on line 110
Output of composer info | sort
:
doctrine/annotations v1.2.7 Docblock Annotations Parser
doctrine/cache v1.6.0 Caching library offering an object-oriented API for many cache backends
doctrine/collections v1.3.0 Collections Abstraction library
doctrine/instantiator 1.0.5 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.
erusev/parsedown 1.6.0 Parser for Markdown.
friendsofphp/php-cs-fixer v1.11.6 A tool to automatically fix PHP code style
myclabs/deep-copy 1.5.1 Create deep copies (clones) of your objects
nyholm/symfony-bundle-test 1.4.0
paragonie/random_compat v2.0.2 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
peridot-php/leo 1.6.1 Next level assertion and matcher library for PHP
phpdocumentor/reflection-common 1.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 3.1.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that ...
phpdocumentor/type-resolver 0.2
phpspec/prophecy 1.7.6 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 4.0.1 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.1 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.8 Utility class for timing
phpunit/php-token-stream 1.4.8 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 5.6.4 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 3.2.3 Mock Object library for PHPUnit
psr/cache 1.0.0 Common interface for caching libraries
psr/log 1.0.0 Common interface for logging libraries
sebastian/code-unit-reverse-lookup 1.0.0 Looks up which function or method a line of code belongs to
sebastian/comparator 1.2.0 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.1 Diff implementation
sebastian/environment 1.3.7 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 1.2.2 Provides the functionality to export PHP variables for visualization
sebastian/global-state 1.1.1 Snapshotting of global state
sebastian/object-enumerator 1.0.0 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context 1.0.2 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.0 Library that helps with managing the version number of Git-hosted PHP projects
symfony/asset v3.1.2 Symfony Asset Component
symfony/cache v3.1.2 Symfony implementation of PSR-6
symfony/class-loader v3.1.2 Symfony ClassLoader Component
symfony/config v3.1.2 Symfony Config Component
symfony/console v3.1.2 Symfony Console Component
symfony/debug v3.1.2 Symfony Debug Component
symfony/dependency-injection v3.1.2 Symfony DependencyInjection Component
symfony/event-dispatcher v3.1.2 Symfony EventDispatcher Component
symfony/filesystem v3.1.2 Symfony Filesystem Component
symfony/finder v3.1.2 Symfony Finder Component
symfony/form v3.1.2 Symfony Form Component
symfony/framework-bundle v3.1.2 Symfony FrameworkBundle
symfony/http-foundation v3.1.2 Symfony HttpFoundation Component
symfony/http-kernel v3.1.2 Symfony HttpKernel Component
symfony/inflector v3.1.2 Symfony Inflector Component
symfony/intl v3.1.2 A PHP replacement layer for the C intl extension that includes additional data from the ICU library.
symfony/options-resolver v3.1.2 Symfony OptionsResolver Component
symfony/polyfill-intl-icu v1.2.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.2.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php56 v1.2.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70 v1.2.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util v1.2.0 Symfony utilities for portability of PHP codes
symfony/process v3.1.2 Symfony Process Component
symfony/property-access v3.1.2 Symfony PropertyAccess Component
symfony/routing v3.1.2 Symfony Routing Component
symfony/security-core v3.1.2 Symfony Security Component - Core Library
symfony/security-csrf v3.1.2 Symfony Security Component - CSRF Library
symfony/stopwatch v3.1.2 Symfony Stopwatch Component
symfony/templating v3.1.2 Symfony Templating Component
symfony/translation v3.1.2 Symfony Translation Component
symfony/yaml v3.1.2 Symfony Yaml Component
twig/twig v1.24.1 Twig, the flexible, fast, and secure template language for PHP
webmozart/assert 1.0.2 Assertions to validate method input/output with nice error messages.
My PHP version:
➜ ~ php -v
PHP 7.2.5 (cli) (built: May 10 2018 20:21:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Hi all,
I see this issue couldn't be resolved due to the reporter not giving feedback. Anyone ever bothered to look into this anyways? I am on PHP 7.2.7 and our code-base is running PHPUnit 5.5.5. I am getting th exact same error. I tried to use the assertSame
method but it did not work.
I cannot apply upgrades on either the application I am working with nor PUPUnit itself without touching on its dependency graph that may have deep relations with other non-dev packages.
Any ideas on how this can be fixed? I am guessing the issue lies with Type-Hinting on the DOMNodeComparator
implementation that was changed for some reason(or for whatever reason I am not sure).
Thanks
@sebastianbergmann maybe we can reopen this?
I have the same error on php 7.2:
$ php -v
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
yyurkevich-nix:email-service (master) eugene$ php vendor/bin/phpunit src/AppBundle/Tests/Unit/Builder/OrderConfirmedEmail/TotalsBuilderTest.php
PHPUnit 4.8.27 by Sebastian Bergmann and contributors.
PHP Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /var/www/email-service/vendor/sebastian/comparator/src/DOMNodeComparator.php on line 110
PHP Stack trace:
PHP 1. {main}() /var/www/email-service/vendor/phpunit/phpunit/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /var/www/email-service/vendor/phpunit/phpunit/phpunit:47
PHP 3. PHPUnit_TextUI_Command->run() /var/www/email-service/vendor/phpunit/phpunit/src/TextUI/Command.php:100
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /var/www/email-service/vendor/phpunit/phpunit/src/TextUI/Command.php:149
PHP 5. PHPUnit_Framework_TestSuite->run() /var/www/email-service/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:440
PHP 6. AppBundle\Tests\Unit\Builder\OrderConfirmedEmail\TotalsBuilderTest->run() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
PHP 7. PHPUnit_Framework_TestResult->run() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestCase.php:724
PHP 8. AppBundle\Tests\Unit\Builder\OrderConfirmedEmail\TotalsBuilderTest->runBare() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestResult.php:612
PHP 9. AppBundle\Tests\Unit\Builder\OrderConfirmedEmail\TotalsBuilderTest->runTest() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestCase.php:768
PHP 10. ReflectionMethod->invokeArgs() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestCase.php:908
PHP 11. AppBundle\Tests\Unit\Builder\OrderConfirmedEmail\TotalsBuilderTest->testBuildsTotals() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/TestCase.php:908
PHP 12. PHPUnit_Framework_Assert::assertEquals() /var/www/email-service/src/AppBundle/Tests/Unit/Builder/OrderConfirmedEmail/TotalsBuilderTest.php:101
PHP 13. PHPUnit_Framework_Assert::assertThat() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/Assert.php:513
PHP 14. PHPUnit_Framework_Constraint_IsEqual->evaluate() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/Assert.php:2255
PHP 15. SebastianBergmann\Comparator\Factory::getInstance() /var/www/email-service/vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php:117
PHP 16. SebastianBergmann\Comparator\Factory->__construct() /var/www/email-service/vendor/sebastian/comparator/src/Factory.php:53
PHP 17. spl_autoload_call() /var/www/email-service/vendor/sebastian/comparator/src/Factory.php:42
PHP 18. Composer\Autoload\ClassLoader->loadClass() /var/www/email-service/vendor/sebastian/comparator/src/Factory.php:42
PHP 19. Composer\Autoload\includeFile() /var/www/email-service/vendor/composer/ClassLoader.php:322
The same on php 5.6 works fine:
# php -v
PHP 5.6.32 (cli) (built: Dec 1 2017 02:57:16)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
root@0dd2027efb87:/var/www# php vendor/bin/phpunit src/AppBundle/Tests/Unit/Builder/OrderConfirmedEmail/TotalsBuilderTest.php
PHPUnit 4.8.27 by Sebastian Bergmann and contributors.
FF
Time: 79 ms, Memory: 7.25MB
I didn't dive into details yet, so I am not completely sure that it is related to php version but looks like.
This is part from composer.json
:
"require": {
"php": ">=5.6.0",
"symfony/symfony": "~2.8",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "~2.11",
"sensio/generator-bundle": "~2.5",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.1",
"jms/serializer-bundle": "~1.1",
"uecode/qpush-bundle": "~2.2",
"aws/aws-sdk-php": "~2.8",
"guzzlehttp/guzzle": "5.3.1 as 6.3.0",
"liuggio/excelbundle": "^2.1",
"lcobucci/jwt": "^3.2",
"phpmailer/phpmailer": "^6.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8",
"mockery/mockery": "~0.9",
"squizlabs/php_codesniffer": "^2.7"
},
composer info:
$ composer info | sort
aws/aws-sdk-php 2.8.31 AWS SDK for PHP - Use Amazon Web Services in your PHP project
doctrine/annotations v1.2.7 Docblock Annotations Parser
doctrine/cache v1.6.0 Caching library offering an object-oriented API for many cache backends
doctrine/collections v1.3.0 Collections Abstraction library
doctrine/common v2.6.1 Common Library for Doctrine projects
doctrine/inflector v1.1.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.0.5 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.
domnikl/statsd 1.1.3 a PHP client for statsd
guzzle/guzzle v3.9.3 PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle
guzzlehttp/guzzle 5.3.1 Guzzle is a PHP HTTP client library and framework for building RESTful web service clients
guzzlehttp/promises v1.3.1 Guzzle promises library
guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
guzzlehttp/ringphp 1.1.0 Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.
guzzlehttp/streams 3.0.0 Provides a simple abstraction over streams of data
hamcrest/hamcrest-php v1.2.2 This is the PHP port of Hamcrest Matchers
incenteev/composer-parameter-handler v2.1.2 Composer script handling your ignored parameter file
ircmaxell/password-compat v1.0.4 A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash
jms/metadata 1.5.1 Class/method/property metadata management in PHP
jms/parser-lib 1.0.0 A library for easily creating recursive-descent parsers.
jms/serializer 1.3.1 Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.
jms/serializer-bundle 1.1.0 Allows you to easily serialize, and deserialize data of any complexity
lcobucci/jwt 3.2.2 A simple library to work with JSON Web Token and JSON Web Signature
liuggio/ExcelBundle v2.1.0 This is a Symfony2 Bundle helps you to read and write Excel files (including pdf, xlsx, odt), thanks to the PHPExcel library
mockery/mockery 0.9.5 Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double f...
monolog/monolog 1.21.0 Sends your logs to files, sockets, inboxes, databases and various web services
paragonie/random_compat v2.0.2 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phpcollection/phpcollection 0.5.0 General-Purpose Collection Library for PHP
phpdocumentor/reflection-common 1.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 3.1.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver 0.2
phpmailer/phpmailer v6.0.6 PHPMailer is a full-featured email creation and transfer class for PHP
phpoffice/phpexcel 1.8.1 PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpoption/phpoption 1.5.0 Option Type for PHP
phpspec/prophecy v1.6.1 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 2.2.4 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 1.4.1 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 1.0.8 Utility class for timing
phpunit/php-token-stream 1.4.8 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 4.8.27 The PHP Unit Testing framework.
phpunit/phpunit-mock-objects 2.3.8 Mock Object library for PHPUnit
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.1 Common interface for logging libraries
react/promise v2.4.1 A lightweight implementation of CommonJS Promises/A for PHP
sebastian/comparator 1.2.0 Provides the functionality to compare PHP values for equality
sebastian/diff 1.4.1 Diff implementation
sebastian/environment 1.3.8 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 1.2.2 Provides the functionality to export PHP variables for visualization
sebastian/global-state 1.1.1 Snapshotting of global state
sebastian/recursion-context 1.0.2 Provides functionality to recursively process PHP variables
sebastian/version 1.0.6 Library that helps with managing the version number of Git-hosted PHP projects
sensio/distribution-bundle v4.0.10 Base bundle for Symfony Distributions
sensio/framework-extra-bundle v3.0.16 This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle v2.5.3 This bundle generates code for you
sensiolabs/security-checker v3.0.2 A security checker for your composer.lock
squizlabs/php_codesniffer 2.7.0 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
swiftmailer/swiftmailer v5.4.3 Swiftmailer, free feature-rich PHP mailer
symfony/monolog-bundle 2.11.1 Symfony MonologBundle
symfony/polyfill-apcu v1.2.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu v1.2.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.2.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php54 v1.2.0 Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55 v1.2.0 Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56 v1.2.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70 v1.2.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util v1.2.0 Symfony utilities for portability of PHP codes
symfony/security-acl v3.0.0 Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.3.11 Symfony SwiftmailerBundle
symfony/symfony v2.8.11 The Symfony PHP framework
twig/twig v1.25.0 Twig, the flexible, fast, and secure template language for PHP
uecode/qpush-bundle 2.2.4 Asynchronous processing for Symfony using Push Queues
webmozart/assert 1.1.0 Assertions to validate method input/output with nice error messages.
Could you recommend something?
Note - for those of you coming here later. This is related to #30, which was manually merged.
Possible solutions:
I run composer update
on machine with php7.2. It resolved the issue with Declaration
.
@sebastianbergmann : Can we a newer version to fix this for PHP 7.3.x. Because my building agent by default picks the latest version of PHP and this bug is failing my build.
I run
composer update
on machine with php7.2. It resolved the issue withDeclaration
.
Same for me with php7.2, composer update
did resolve the issue
In case anyone else stumbles on this issue, upgrading sebastian/comparator to v1.2.4 worked for me
$ composer update sebastian/comparator
(...)
- Updating sebastian/comparator (1.2.0 => 1.2.4): Loading from cache
(...)
@sebastianbergmann Test 'goalNumberSurveyTest::testNumberSurvey' started PHP Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /var/lib/jenkins/workspace/wobo-pull-pipeline/lib/php/guzzle/sebastian/comparator/src/DOMNodeComparator.php on line 110
Hello , I installed phpunit globally and I had the same issue of compatibility with php 7. I resolved by updating the latest version of phpunit7. this is how to install globally: (I'm on windows) 1 - download the latest version: phpunit7 2- put it in directory accecisbe Variable path (e.g C: \ bin ) 3- create a phpunit7.cmd file containing this: @php "% ~ dp0phpunit-7.x.xx.phar"% *
and run : c:\phpunit --version
and everything is back to normal
I'm experiencing this issue in a project of mine, when I try to test with PHP 7.2 (so, with phpunit 8.5.18).
I am also experiencing the same issue, When we run the phpunit test command. Getting the following error.
Fatal error: Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in phar:///Applications/MAMP/Library/bin/phpunit-5.1.3.phar/sebastian-comparator/DOMNodeComparator.php on line 110
Is there any work around for solving this issue.
My PHP version is PHP 7.3.24
Upgraded the PHP version to 7.4.12, then solved the issue. This is on mac.
I have the same issue php8.1 /symfony6.2
composer info
amphp/amp v2.6.2 A non-blocking concurrency framework for PHP applications.
amphp/byte-stream v1.8.1 A stream abstraction to make working with non-blocking I/O simple.
amphp/parallel v1.4.2 Parallel processing component for Amp.
amphp/parallel-functions v1.1.0 Parallel processing made simple.
amphp/parser v1.1.0 A generator parser to make streaming parsers simple.
amphp/process v1.1.4 Asynchronous process manager.
amphp/serialization v1.0.0 Serialization tools for IPC and data storage in PHP.
amphp/sync v1.4.2 Mutex, Semaphore, and other synchronization tools for Amp.
aws/aws-crt-php v1.0.4 AWS Common Runtime for PHP
aws/aws-sdk-php 3.258.9 AWS SDK for PHP - Use Amazon Web Services in your PHP project
beberlei/doctrineextensions v1.3.0 A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.
clue/stream-filter v1.6.0 A simple and modern approach to stream filtering in PHP
cocur/slugify v3.2 Converts a string into a slug.
composer/package-versions-deprecated 1.11.99.4 Composer plugin that provides efficient querying for installed package versions (no runtime IO)
dama/doctrine-test-bundle v7.2.1 Symfony bundle to isolate doctrine database tests and improve test performance
dealerdirect/phpcodesniffer-composer-installer v0.7.2 PHP_CodeSniffer Standards Composer Installer Plugin
doctrine/annotations 1.14.3 Docblock Annotations Parser
doctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/coding-standard 9.0.2 The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.
doctrine/collections 1.8.0 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common 3.4.3 PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxi...
doctrine/data-fixtures 1.6.3 Data Fixtures for all Doctrine Object Managers
doctrine/dbal 3.6.0 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/deprecations v1.0.0 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/doctrine-bundle 2.8.3 Symfony DoctrineBundle
doctrine/doctrine-fixtures-bundle 3.4.2 Symfony DoctrineFixturesBundle
doctrine/doctrine-migrations-bundle 3.2.2 Symfony DoctrineMigrationsBundle
doctrine/event-manager 2.0.0 The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector 2.0.6 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator 1.5.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer 2.1.0 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations 3.5.5 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily d...
doctrine/orm 2.14.1 Object-Relational-Mapper for PHP
doctrine/persistence 3.1.4 The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
doctrine/sql-formatter 1.1.3 a PHP SQL highlighting library
docusign/esign-client v6.12.0 The DocuSign PHP library makes integrating DocuSign into your websites a super fast and painless process. The library is open sourced on GitHub, look for the d...
egulias/email-validator 4.0.1 A library for validating emails against several RFCs
elasticsearch/elasticsearch v7.17.1 PHP Client for Elasticsearch
ergebnis/classy 1.4.0 Provides a finder for classy constructs (classes, enums, interfaces, and traits).
ergebnis/factory-bot 0.4.0 Provides a fixture factory for doctrine/orm entities.
ezimuel/guzzlestreams 3.1.0 Fork of guzzle/streams (abandoned) to be used with elasticsearch-php
ezimuel/ringphp 1.2.2 Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-php
ezyang/htmlpurifier v4.16.0 Standards compliant HTML filter written in PHP
fakerphp/faker v1.21.0 Faker is a PHP library that generates fake data for you.
firebase/php-jwt v5.5.1 A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.
friendsofphp/proxy-manager-lts v1.0.14 Adding support for a wider range of PHP versions to ocramius/proxy-manager
gitonomy/gitlib v1.3.7 Library for accessing git
google/apiclient v2.13.0 Client library for Google APIs
google/apiclient-services v0.287.0 Client library for Google APIs
google/auth v1.25.0 Google Auth Library for PHP
guzzlehttp/guzzle 6.5.8 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.5.2 Guzzle promises library
guzzlehttp/psr7 1.9.0 PSR-7 message implementation that also provides common utility methods
hautelook/alice-bundle 2.11.0 Symfony bundle to manage fixtures with Alice and Faker.
http-interop/http-factory-guzzle 1.2.0 An HTTP Factory using Guzzle PSR7
hubspot/api-client 2.8.1 Hubspot API client
hwi/oauth-bundle 2.0.0-BETA2 Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.
jean85/pretty-package-versions 2.0.5 A library to get pretty versions strings of installed dependencies
jolicode/elastically v1.6.0 Opinionated Elastica based framework to bootstrap PHP and Elasticsearch implementations.
laminas/laminas-code 4.8.0 Extensions to the PHP Reflection API, static code scanning, and code generation
laravel/serializable-closure v1.3.0 Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.
league/flysystem 2.5.0 File storage abstraction for PHP
league/flysystem-aws-s3-v3 2.5.0 AWS S3 filesystem adapter for Flysystem.
league/flysystem-memory 3.10.3 In-memory filesystem adapter for Flysystem.
league/mime-type-detection 1.11.0 Mime-type detection for Flysystem
lorenzo/pinky 1.0.9 A Foundation for Emails (Inky) template transpiler
maennchen/zipstream-php v2.4.0 ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.
markbaker/complex 3.0.2 PHP Class for working with complex numbers
markbaker/matrix 3.0.1 PHP Class for working with matrices
masterminds/html5 2.7.6 An HTML5 parser and serializer.
moneyphp/money v3.3.3 PHP implementation of Fowler's Money pattern
monolog/monolog 3.3.1 Sends your logs to files, sockets, inboxes, databases and various web services
mpdf/mpdf v8.0.17 PHP library generating PDF files from UTF-8 encoded HTML
mtdowling/jmespath.php 2.6.1 Declaratively specify how to extract elements from a JSON document
myclabs/deep-copy 1.11.0 Create deep copies (clones) of your objects
myclabs/php-enum 1.8.4 PHP Enum implementation
nelmio/alice 3.12.2 Expressive fixtures generator
nelmio/api-doc-bundle v4.11.1 Generates documentation for your REST API from annotations
nelmio/cors-bundle 2.2.0 Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
nesbot/carbon 2.66.0 An API extension for DateTime that supports 281 different languages.
nikic/php-parser v4.15.3 A PHP parser written in PHP
nyholm/dsn 2.0.1 Parse your DSN strings in a powerful and flexible way
nyholm/psr7 1.5.1 A fast PHP7 implementation of PSR-7
ondram/ci-detector 4.1.0 Detect continuous integration environment and provide unified access to properties of current build
oneup/flysystem-bundle 4.6.0 Integrates Flysystem filesystem abstraction library to your Symfony project.
paragonie/constant_time_encoding v2.6.3 Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
php-http/client-common 2.6.0 Common HTTP Client implementations and tools for HTTPlug
php-http/discovery 1.15.2 Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations
php-http/guzzle6-adapter v2.0.2 Guzzle 6 HTTP Adapter
php-http/httplug 2.3.0 HTTPlug, the HTTP client abstraction for PHP
php-http/httplug-bundle 1.27.0 Symfony integration for HTTPlug
php-http/logger-plugin 1.3.0 PSR-3 Logger plugin for HTTPlug
php-http/message 1.13.0 HTTP Message related tools
php-http/message-factory v1.0.2 Factory interfaces for PSR-7 HTTP Message
php-http/promise 1.1.0 Promise used for asynchronous HTTP requests
php-http/stopwatch-plugin 1.4.1 Symfony Stopwatch plugin for HTTPlug
phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 5.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver 1.6.2 A PSR-5 based resolver of Class names, Types and Structural Element Names
phpoffice/phpspreadsheet 1.27.1 PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpro/grumphp v1.15.0 A composer plugin that enables source code quality checks.
phpseclib/phpseclib 3.0.18 PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.
phpstan/extension-installer 1.2.0 Composer plugin for automatic installation of PHPStan extensions
phpstan/phpdoc-parser 1.16.1 PHPDoc parser with support for nullable, intersection and generic types
phpstan/phpstan 1.9.17 PHPStan - PHP Static Analysis Tool
phpstan/phpstan-doctrine 1.3.32 Doctrine extensions for PHPStan
phpstan/phpstan-phpunit 1.3.4 PHPUnit extensions and rules for PHPStan
phpstan/phpstan-symfony 1.2.23 Symfony Framework extensions and rules for PHPStan
psr/cache 3.0.0 Common interface for caching libraries
psr/container 2.0.2 Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher 1.0.0 Standard interfaces for event handling.
psr/http-client 1.0.1 Common interface for HTTP clients
psr/http-factory 1.0.1 Common interfaces for PSR-7 HTTP message factories
psr/http-message 1.0.1 Common interface for HTTP messages
psr/link 2.0.1 Common interfaces for HTTP links
psr/log 2.0.0 Common interface for logging libraries
psr/simple-cache 3.0.0 Common interfaces for simple caching
pugx/autocompleter-bundle v1.9.0 Add an autocomplete type to forms
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
react/promise v2.9.0 A lightweight implementation of CommonJS Promises/A for PHP
ruflin/elastica 7.3.0 Elasticsearch Client
scienta/doctrine-json-functions 4.4.0 A set of extensions to Doctrine 2 that add support for json query functions.
sebastian/comparator 5.0.0 Provides the functionality to compare PHP values for equality
sebastian/diff 5.0.0 Diff implementation
sebastian/exporter 5.0.0 Provides the functionality to export PHP variables for visualization
sebastian/recursion-context 5.0.0 Provides functionality to recursively process PHP variables
seld/jsonlint 1.9.0 JSON Linter
sensio/framework-extra-bundle v6.2.9 This bundle provides a way to configure your controllers with annotations
sentry/sdk 3.3.0 This is a metapackage shipping sentry/sentry with a recommended HTTP client.
sentry/sentry 3.13.0 A PHP SDK for Sentry (http://sentry.io)
sentry/sentry-symfony 4.5.0 Symfony integration for Sentry (http://getsentry.com)
setasign/fpdi v2.3.7 FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also pos...
slevomat/coding-standard 7.2.1 Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.
squizlabs/php_codesniffer 3.7.1 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
symfony/apache-pack v1.0.1 A pack for Apache support in Symfony
symfony/asset v6.2.5 Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files
symfony/browser-kit v6.2.5 Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/cache v6.2.5 Provides extended PSR-6, PSR-16 (and tags) implementations
symfony/cache-contracts v3.2.0 Generic abstractions related to caching
symfony/config v6.2.5 Helps you find, load, combine, autofill and validate configuration values of any kind
symfony/console v6.2.5 Eases the creation of beautiful and testable command line interfaces
symfony/css-selector v6.2.5 Converts CSS selectors to XPath expressions
symfony/debug-bundle v6.2.5 Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework
symfony/dependency-injection v6.2.6 Allows you to standardize and centralize the way objects are constructed in your application
symfony/deprecation-contracts v3.2.0 A generic function and convention to trigger deprecation notices
symfony/doctrine-bridge v6.2.5 Provides integration for Doctrine with various Symfony components
symfony/doctrine-messenger v6.2.5 Symfony Doctrine Messenger Bridge
symfony/dom-crawler v6.2.5 Eases DOM navigation for HTML and XML documents
symfony/dotenv v6.2.5 Registers environment variables from a .env file
symfony/error-handler v6.2.5 Provides tools to manage errors and ease debugging PHP code
symfony/event-dispatcher v6.2.5 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v3.2.0 Generic abstractions related to dispatching event
symfony/expression-language v6.2.5 Provides an engine that can compile and evaluate expressions
symfony/filesystem v6.2.5 Provides basic utilities for the filesystem
symfony/finder v6.2.5 Finds files and directories via an intuitive fluent interface
symfony/flex v1.19.4 Composer plugin for Symfony
symfony/form v6.2.5 Allows to easily create, process and reuse HTML forms
symfony/framework-bundle v6.2.5 Provides a tight integration between Symfony components and the Symfony full-stack framework
symfony/http-client v6.2.6 Provides powerful methods to fetch HTTP resources synchronously or asynchronously
symfony/http-client-contracts v3.2.0 Generic abstractions related to HTTP clients
symfony/http-foundation v6.2.6 Defines an object-oriented layer for the HTTP specification
symfony/http-kernel v6.2.6 Provides a structured process for converting a Request into a Response
symfony/intl v6.2.5 Provides a PHP replacement layer for the C intl extension that includes additional data from the ICU library
symfony/mailer v6.2.5 Helps sending emails
symfony/maker-bundle v1.48.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.
symfony/messenger v6.2.5 Helps applications send and receive messages to/from other applications or via message queues
symfony/mime v6.2.5 Allows manipulating MIME messages
symfony/monolog-bridge v6.2.5 Provides integration for Monolog with various Symfony components
symfony/monolog-bundle v3.8.0 Symfony MonologBundle
symfony/options-resolver v6.2.5 Provides an improved replacement for the array_replace PHP function
symfony/password-hasher v6.2.5 Provides password hashing utilities
symfony/phpunit-bridge v6.2.5 Provides utilities for PHPUnit, especially user deprecation notices management
symfony/polyfill-intl-grapheme v1.27.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-icu v1.27.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-intl-idn v1.27.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-intl-messageformatter v1.27.0 Symfony polyfill for intl's MessageFormatter class and related functions
symfony/polyfill-intl-normalizer v1.27.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring v1.27.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php73 v1.27.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80 v1.27.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-uuid v1.27.0 Symfony polyfill for uuid functions
symfony/process v6.2.5 Executes commands in sub-processes
symfony/property-access v6.2.5 Provides functions to read and write from/to an object or array using a simple string notation
symfony/property-info v6.2.5 Extracts information about PHP class' properties using metadata of popular sources
symfony/proxy-manager-bridge v6.2.5 Provides integration for ProxyManager with various Symfony components
symfony/psr-http-message-bridge v2.1.4 PSR HTTP message bridge
symfony/routing v6.2.5 Maps an HTTP request to a set of configuration variables
symfony/runtime v6.2.5 Enables decoupling PHP applications from global state
symfony/security-bundle v6.2.6 Provides a tight integration of the Security component into the Symfony full-stack framework
symfony/security-core v6.2.5 Symfony Security Component - Core Library
symfony/security-csrf v6.2.5 Symfony Security Component - CSRF Library
symfony/security-http v6.2.6 Symfony Security Component - HTTP Integration
symfony/serializer v6.2.5 Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.
symfony/service-contracts v3.2.0 Generic abstractions related to writing services
symfony/stopwatch v6.2.5 Provides a way to profile code
symfony/string v6.2.5 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/templating v6.2.5 Provides all the tools needed to build any kind of template system
symfony/translation v6.2.5 Provides tools to internationalize your application
symfony/translation-contracts v3.2.0 Generic abstractions related to translation
symfony/twig-bridge v6.2.5 Provides integration for Twig with various Symfony components
symfony/twig-bundle v6.2.5 Provides a tight integration of Twig into the Symfony full-stack framework
symfony/uid v6.2.5 Provides an object-oriented API to generate and represent UIDs
symfony/validator v6.2.5 Provides tools to validate values
symfony/var-dumper v6.2.5 Provides mechanisms for walking through any arbitrary PHP variable
symfony/var-exporter v6.2.5 Allows exporting any serializable PHP data structure to plain PHP code
symfony/web-link v6.2.5 Manages links between resources
symfony/web-profiler-bundle v6.2.5 Provides a development tool that gives detailed information about the execution of any request
symfony/yaml v6.2.5 Loads and dumps YAML files
theofidry/alice-data-fixtures 1.6.0 Nelmio alice extension to persist the loaded fixtures.
tijsverkoyen/css-to-inline-styles 2.2.6 CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending ema...
twig/cssinliner-extra v3.5.1 A Twig extension to allow inlining CSS
twig/extra-bundle v3.5.1 A Symfony bundle for extra Twig extensions
twig/inky-extra v3.5.1 A Twig extension for the inky email templating engine
twig/string-extra v3.5.1 A Twig extension for Symfony String
twig/twig v3.5.1 Twig, the flexible, fast, and secure template language for PHP
webmozart/assert 1.11.0 Assertions to validate method input/output with nice error messages.
zircote/swagger-php 4.6.1 swagger-php - Generate interactive documentation for your RESTful API using phpdoc annotations
@elitecolors The declaration of the ArrayComparator
is incompatible with the abstract comparator
one.
Try to downgrade sebastian/comparator
to version "4.0.8" until that one fixed
@vichanse it's not a good idea since this will land to other problems.
In my case the problem was with Alice bundle I find a solution to add auto dump to json config file.
I will add more details tomorrow.
The problem that Alice bundle use old version for comparator.
It was just a temporary fix time to find where the problem comes from. Can you share your solution ? I have alice bundle installed too
yes in composer.json
section config add
"optimize-autoloader": true,
"prepend-autoloader": false,
Excellent. Thank you @elitecolors . It works like a charm
Hey @elitecolors i would like to understand what does the prepend-autoloader that helped fix the problem 🤷🏾♂️. Can you explain it to me ?
Tag: 2.1.3
https://github.com/sebastianbergmann/comparator/pull/30/files
Missing changes, failing on PHPUnit