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

Call to an undefined method Mockery\ExpectationInterface|Mockery\ExpectsHigherOrderMessage::once() #11

Closed
simPod opened this issue Aug 21, 2019 · 3 comments · Fixed by #26

Comments

@simPod
Copy link
Contributor

simPod commented Aug 21, 2019

$mock = Mockery::mock(MyClass::class);

self::assertSth($mock);

...

private function assertSth(MockInterface $mock) : void
{
    $mock->expect('call')->once();
}

Gives

Call to an undefined method Mockery\ExpectationInterface|Mockery\ExpectsHigherOrderMessage::once()

v0.11.3

Not sure if doable 🤔

@ruudk
Copy link
Contributor

ruudk commented Dec 12, 2019

Same issue with:

        $form->shouldReceive('get->getData')->times(2)->andReturnNull();
Call to an undefined method
         Mockery\ExpectationInterface|Mockery\HigherOrderMessage::times().

@jdeniau
Copy link

jdeniau commented Apr 29, 2020

For the record I do not have this issue anymore by upgrading from 0.12.3 to 0.12.5

ruudk referenced this issue in ruudk/phpstan-mockery Feb 3, 2021
This fixes the issue when using:

```
$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()
```

Fixes #11
ruudk referenced this issue in ruudk/phpstan-mockery Feb 3, 2021
This fixes the issue when using:

```
$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()
```

Fixes #11
ruudk referenced this issue in ruudk/phpstan-mockery Feb 3, 2021
This fixes the issue when using:

```
$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()
```

Add tests for `shouldHaveReceived` and `shouldNotHaveReceived`.

Fixes #11
ondrejmirtes pushed a commit that referenced this issue Feb 5, 2021
This fixes the issue when using:

```
$this->fooMock->shouldNotReceive('doFoo')->andReturn('bar');
// Call to an undefined method Mockery\ExpectationInterface|Mockery\HigherOrderMessage::andReturn()
```

Add tests for `shouldHaveReceived` and `shouldNotHaveReceived`.

Fixes #11
@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants