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 working with PHPUnit 6.5 #21

Closed
OndraM opened this issue Dec 1, 2017 · 3 comments
Closed

Not working with PHPUnit 6.5 #21

OndraM opened this issue Dec 1, 2017 · 3 comments
Milestone

Comments

@OndraM
Copy link

OndraM commented Dec 1, 2017

Hi, the library is not working with PHPUnit 6.5 (phpunit-mock-objects 5).

<?php declare(strict_types=1);

namespace My;

use phpmock\phpunit\PHPMock;

class WillItWorkTest extends \PHPUnit\Framework\TestCase
{
    use PHPMock;

    public function testFoo(): void
    {
        $time = $this->getFunctionMock(__NAMESPACE__, 'time');
    }
}

Results in:

PHP Fatal error: Interface 'PHPUnit_Framework_MockObject_Matcher_Invocation' not found in /.../vendor/php-mock/php-mock-phpunit/classes/DefaultArgumentRemover.php on line 15

Version of relevant installed packages:
phpunit/phpunit 6.5.1
phpunit/phpunit-mock-objects 5.0.3
php-mock/php-mock 2.0.0
php-mock/php-mock-integration 2.0.0
php-mock/php-mock-phpunit 2.0.0

May be related to sebastianbergmann/phpunit-mock-objects#388 ?

malkusch added a commit that referenced this issue Dec 2, 2017
PHPUnit-6.5 did change the signature of TestCase::getMockBuilder() by
returning an object from phpunit-mock-object-5 instead of
phpunit-mock-object-4. This broke this library:

  PHP Fatal error: Interface 'PHPUnit_Framework_MockObject_Matcher_Invocation'
  not found in /.../vendor/php-mock/php-mock-phpunit/classes/DefaultArgumentRemover.php
  on line 15

This commit adds a <phpunit-6.5 constraint to fix the current release.
PHPUnit-6.5 is currently not supported by this library. I wait for
sebastianbergmann/phpunit#2893 to decide how to support PHPUnit-6.5.

See also: #21
See also: sebastianbergmann/phpunit#2893
@michalbundyra
Copy link
Member

@malkusch any progress on it?

@OndraM
Copy link
Author

OndraM commented Jan 19, 2018

Or maybe this could be part of PHPUnit 7.0 support (to be released February 2nd), so BC changes could be introduced?

@michalbundyra
Copy link
Member

@OndraM Please see #27

@michalbundyra michalbundyra added this to the 2.1.0 milestone Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants