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

Failing to properly create mock for mysqli class #1206

Open
alexdawn opened this issue Jan 23, 2023 · 0 comments
Open

Failing to properly create mock for mysqli class #1206

alexdawn opened this issue Jan 23, 2023 · 0 comments

Comments

@alexdawn
Copy link

With Mockery 1.5.1 and phpunit 9.5.28

I am creating a mock for the inbuilt php class sqli with:
$this->sqliMock = Mockery::mock(mysqli::class);
then adding it to the SUT with dependency injection
this is working and I get a mockery object. However I am unable to then set expectations on it. Comparing this mock with another mock object for one of my own classes in xdebug I see that $this->sqliMock is lacking all the _mockery_* properties I normally see on an mock with the exception of _mockery_methods.

The only odd thing going on is that in the SUT the dependency is stored in a static property, is this what could be messing up the mock?

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

1 participant