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

Mocking class with method 'provide' fails since 6.5.x #2891

Closed
frederikbosch opened this issue Dec 1, 2017 · 2 comments
Closed

Mocking class with method 'provide' fails since 6.5.x #2891

frederikbosch opened this issue Dec 1, 2017 · 2 comments

Comments

@frederikbosch
Copy link

Q A
PHPUnit version 6.5.0-1
PHP version 7.1.12
Installation Method Composer

Since version 6.5.0 I have problems with mocking a specific class: DomainProviderInterface. It seems to be related to the method provide that is part of the class.

namespace Genkgo\TestFramework;

use PHPUnit\Framework\TestCase;

final class DomainNameCollection {}

interface DomainProviderInterface {
    public function provide(): DomainNameCollection;
    public function persist(DomainNameCollection $domains): void;
}

final class Test extends TestCase {
    public function test() {
        $mock = $this->createMock(DomainProviderInterface::class);
        $this->assertInstanceOf(DomainProviderInterface::class, $mock);
    }
}

Above code works in 6.4.x, but fails in 6.5.x. I tested both 6.5.0 and 6.5.1.

@sebastianbergmann
Copy link
Owner

This should have been reported on the phpunit-mock-objects project.

I am sorry that I have to close this issue here as GitHub does not support moving issues from one project to another.

@frederikbosch
Copy link
Author

Thanks, see sebastianbergmann/phpunit-mock-objects#388 now.

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