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

Some currently unsupported cases #3

Closed
arnaud-lb opened this issue Nov 22, 2018 · 3 comments
Closed

Some currently unsupported cases #3

arnaud-lb opened this issue Nov 22, 2018 · 3 comments

Comments

@arnaud-lb
Copy link

Some expectation methods

$mock = Mockery::mock(Something::class);
$mock
    ->shouldReceive('foo')
    ->andReturn(null)
    ->shouldReceive('bar');

Currently, the second shouldReceive call will trigger this error: Call to an undefined method Mockery\Expectation::shouldReceive().

Partial mocks

$mock = Mockery::mock('Foo\Bar[method1,method2]');

Currently, $mock is assumed to be of type Foo\Bar[method1,method2]

Methods returning Mock

$mock = Mockery::mock(Bar::class)->shouldDeferMissing();

Currently, methods returning Mockery\Mock will just return that, instead of an intersection type.

@jaydiablo
Copy link

Also doesn't currently support the alias mock syntax:

Mockery::mock('alias:Foo\Bar')
            ->shouldReceive('bar')

Call to method shouldReceive() on an unknown class alias:Foo\Bar.

@ondrejmirtes
Copy link
Member

Solved with #6.

@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

No branches or pull requests

3 participants