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

Fix Mockery::fetchMock() without initialized container #1113

Closed
wants to merge 1 commit into from

Conversation

PhrozenByte
Copy link
Contributor

Calling Mockery::fetchMock() first doesn't make much sense and likely indicates a logic error, but Mockery should nevertheless throw Call to a member function fetchMock() on null errors.

Maybe we should throw a LogicException instead when no container was initialized yet (just like Mockery::self())? If no container was initialized yet, Mockery::fetchMock() will always return null, just like if the mock in question simply doesn't exist (yet). Other opinions?

@GrahamCampbell
Copy link
Contributor

This should probably be fixed on the 1.3.x branch.

@PhrozenByte PhrozenByte changed the base branch from master to 1.3 January 24, 2021 21:06
@PhrozenByte PhrozenByte changed the base branch from 1.3 to master January 24, 2021 21:06
@PhrozenByte
Copy link
Contributor Author

Are you guys working in the 1.3 branch and merging changes back to master (i.e. I should create a PR on the 1.3 branch and close this one), or can this be merged into master and merged into 1.3? Or do you prefer separate PRs with different commits?

@GrahamCampbell
Copy link
Contributor

I would say just send to 1.3. I can handle any 1.3 -> master merges if needed. :)

@GrahamCampbell
Copy link
Contributor

The reason for this is just that 1.4.x doesn't support PHP 7.1 and 7.2, so it makes sense to land bug fixes in the 1.3.x series, for the rest of the year, at least.

@PhrozenByte
Copy link
Contributor Author

PhrozenByte commented Jan 24, 2021

Alright, here you go #1114 👍 😃

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

Successfully merging this pull request may close these issues.

None yet

2 participants