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

makeWith or make does not return mocked object when testing #25401

Closed
JValck opened this issue Sep 1, 2018 · 1 comment
Closed

makeWith or make does not return mocked object when testing #25401

JValck opened this issue Sep 1, 2018 · 1 comment

Comments

@JValck
Copy link

JValck commented Sep 1, 2018

  • Laravel Version: 5.6.29
  • PHP Version: 7.2.7

Description:

The service container does not resolve the mocked object when using the makeWith method with parameters. It does work when using the make method without parameters, but neither does when using parameters.

Steps To Reproduce:

  1. In the test bind a mock: $this->app->bind('App\Model\User', \Mockery::mock('App\Model\User'));
  2. Resolve the App\Model\User with the resolve helper or make method without using parameters. This will return the mock which is ok.
  3. Resolve the App\Model\User with makeWith or make for example: $this->app->makeWith('App\Model\User', ['name' => 'JValck']); This will return the actual implementation instead of the mock.
@X-Coder264
Copy link
Contributor

#19450 #25041

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

3 participants