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

[5.8] Fixed circular dependency - fix #28165 #28164

Merged
merged 3 commits into from
Apr 11, 2019
Merged

[5.8] Fixed circular dependency - fix #28165 #28164

merged 3 commits into from
Apr 11, 2019

Conversation

kauanslr
Copy link
Contributor

@kauanslr kauanslr commented Apr 10, 2019

This PR fix the issue opened by me (#28165).

Basically, this code override the QueueManager::__call magic method when the Queue is mocked to prevend a circular dependency when calling a undefined method in the mock.

To prevent any break of existing feature i've made a simple test.

@driesvints driesvints changed the title Fixed circular dependency - fix #28163 [5.8Fixed circular dependency - fix #28163 Apr 10, 2019
@driesvints driesvints changed the title [5.8Fixed circular dependency - fix #28163 [5.8] Fixed circular dependency - fix #28163 Apr 10, 2019
@kauanslr kauanslr changed the title [5.8] Fixed circular dependency - fix #28163 [5.8] Fixed circular dependency - fix #28165 Apr 10, 2019
@taylorotwell
Copy link
Member

Tests fail?

@kauanslr
Copy link
Contributor Author

Tests fail?

Yes, i'm looking this.

Two memcached tests failed with PHP7.1, i'm trying to reproduce locally.

@kauanslr
Copy link
Contributor Author

Done.

But the Travis is crazy.

@taylorotwell taylorotwell merged commit 68981ba into laravel:5.8 Apr 11, 2019
@antoniopaisfernandes
Copy link
Contributor

I've got a failing test when updating to 5.8.12

There was 1 error:

1) Tests\Feature\Claims\ArrivingAtTheWarehouseTest::dri_cores_are_split_by_UK_and_PL
BadMethodCallException: Call to undefined method Illuminate\Support\Testing\Fakes\QueueFake::assertPushedTimes()

@chrismeh
Copy link

chrismeh commented Apr 17, 2019

assertPushedTimes is protected. Due to this fix, calls to assertPushedTimes will always hit __call and throw a BadMethodCallException. We could probably just go ahead and make assertPushedTimes public aswell?

@kauanslr
Copy link
Contributor Author

kauanslr commented Apr 17, 2019

We'll, looks like there many protected asserts. As @chrismeh mentioned, we cold just make these methods public.
I'll proceed with an PR with this resolution and create some tests to this problem too.

@kauanslr
Copy link
Contributor Author

I've got a failing test when updating to 5.8.12

There was 1 error:

1) Tests\Feature\Claims\ArrivingAtTheWarehouseTest::dri_cores_are_split_by_UK_and_PL
BadMethodCallException: Call to undefined method Illuminate\Support\Testing\Fakes\QueueFake::assertPushedTimes()

Maybe, a alternative is to use assertPushed and pass times in callback parameter.

@antoniopaisfernandes
Copy link
Contributor

@kauanslr I've, since, done that.

Queue::assertPushed(PrintAndEmail::class, 2);

I just viewed assertPushedTimes as a more verbose way of testing what I intended.

Thanks anyway.

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.

4 participants