Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not compatible with PHPUnit 7.0.0 #117

Closed
sudar opened this issue Feb 12, 2018 · 5 comments
Closed

Not compatible with PHPUnit 7.0.0 #117

sudar opened this issue Feb 12, 2018 · 5 comments
Assignees
Labels
Bug Bug report or pull requests that addresses a bug

Comments

@sudar
Copy link
Contributor

sudar commented Feb 12, 2018

In PHPUnit 7.0.0, the phpunit framework has added return types to all the methods in the \PHPUnit\Framework\TestCase class.

The WP_Mock\Tools\TestCase class extends \PHPUnit\Framework\TestCase and therefore these methods also should explicitly add the return types. If not PHP is throwing fatal errors.

Some sample errors that are thrown are

Fatal error: Declaration of WP_Mock\Tools\TestCase::run(?PHPUnit\Framework\TestResult $result = NULL) must be compatible with PHPUnit\Framework\Test::run(?PHPUnit\Framework\TestResult $result = NULL): PHPUnit\Framework\TestResult in /Users/sudar/Dropbox/code/wp/bulk-wp/bulk-move/vendor/10up/wp_mock/php/WP_Mock/Tools/TestCase.php on line 14
Fatal error: Declaration of WP_Mock\Tools\TestCase::run(?PHPUnit\Framework\TestResult $result = NULL): WP_Mock\Tools\PHPUnit\Framework\TestResult must be compatible with PHPUnit\Framework\Test::run(?PHPUnit\Framework\TestResult $result = NULL): PHPUnit\Framework\TestResult in /Users/sudar/Dropbox/code/wp/bulk-wp/bulk-move/vendor/10up/wp_mock/php/WP_Mock/Tools/TestCase.php on line 14
Fatal error: Declaration of WP_Mock\Tools\Constraints\ExpectationsMet::matches($other) must be compatible with PHPUnit\Framework\Constraint\Constraint::matches($other): bool in /Users/sudar/Dropbox/code/wp/bulk-wp/bulk-move/vendor/10up/wp_mock/php/WP_Mock/Tools/Constraints/ExpectationsMet.php on line 40
Fatal error: Declaration of WP_Mock\Tools\Constraints\ExpectationsMet::additionalFailureDescription($other) must be compatible with PHPUnit\Framework\Constraint\Constraint::additionalFailureDescription($other): string in /Users/sudar/Dropbox/code/wp/bulk-wp/bulk-move/vendor/10up/wp_mock/php/WP_Mock/Tools/Constraints/ExpectationsMet.php on line 40

etc.

@jmichaelward
Copy link

I just came here to open the same issue. +1.

@manuelRod
Copy link

same here

@ericmann ericmann self-assigned this May 14, 2018
@ericmann ericmann added the Bug Bug report or pull requests that addresses a bug label May 14, 2018
@spikeydaiki
Copy link

spikeydaiki commented May 23, 2018

I have the same problem with PHPUnit_Extensions_Selenium2TestCase

Fatal error: Declaration of PHPUnit_Extensions_Selenium2TestCase::run(?PHPUnit\Framework\TestResult $result = NULL) must be compatible with PHPUnit\Framework\Test::run(?PHPUnit\Framework\TestResult $result = NULL): PHPUnit\Framework\TestResult in /Applications/XAMPP/xamppfiles/htdocs/Project_PRAEPOM/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase.php

@emeraldjava
Copy link

I believe i hit the same issue with

PHP Fatal error: Declaration of WP_Mock\Tools\TestCase::expectOutputString($expectedString) must be compatible with PHPUnit\Framework\TestCase::expectOutputString(string $expectedString): void in /home/bhaa/projects/bhaa_wordpress_plugin/vendor/10up/wp_mock/php/WP_Mock/Tools/TestCase.php on line 318

@jlillyreed
Copy link

jlillyreed commented Jan 15, 2019

Yep, I am also experiencing this from the clean install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug report or pull requests that addresses a bug
Projects
None yet
Development

No branches or pull requests

7 participants