sebastianbergmann / comparator

Provides the functionality to compare PHP values for equality.
BSD 3-Clause "New" or "Revised" License
6.97k stars 67 forks source link

Mac OS - MAMP - phpunit fails silently with error in log file #67

Closed crouti closed 5 years ago

crouti commented 5 years ago

In the MAMP php log file

[08-Nov-2018 09:14:00 UTC] 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:///Applications/MAMP/Library/bin/phpunit-5.1.3.phar/sebastian-comparator/DOMNodeComparator.php on line 110

composer info | sort

gives

No composer.json in current directory, do you want to use the one at /Applications/MAMP/htdocs/oraalgo? [Y,n]? Y
doctrine/instantiator              1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
myclabs/deep-copy                  1.8.1 Create deep copies (clones) of your objects
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.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
phpspec/prophecy                   1.8.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage          6.1.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.0.0 Utility class for timing
phpunit/php-token-stream           3.0.1 Wrapper around PHP's tokenizer extension.
phpunit/phpunit                    7.4.3 The PHP Unit Testing framework.
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.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      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
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.

Any idea how i could make phpunit start correctly ? Thanks

sebastianbergmann commented 5 years ago

You appear to have a project-local version of PHPUnit installed using Composer but instead of invoking that (using ./vendor/bin/phpunit) you invoke another version of PHPUnit (using phpunit, for instance).

crouti commented 5 years ago

Thanks a lot, but if i use this version

../../../vendor/bin/phpunit -c multisite.xml

I still get a fatal error

Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /private/var/folders/j3/t3yfbrhd6q3f__6dhfcmxnjc0000gn/T/wordpress-tests-lib/includes/phpunit6-compat.php on line 18

What should i do, remove the phpunit installed via composer and use the one delivered with MAMP ?