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.3] Make afterApplicationCreated() callback registration public #15493

Merged
merged 1 commit into from
Sep 18, 2016

Conversation

mfn
Copy link
Contributor

@mfn mfn commented Sep 18, 2016

Rational: when using e.g. PHPUnit Listener we receive the test class before a certain test has run.

This allows further inspection or adding additional stuff.

Unfortunately it doesn't allow registering additional after application callbacks from e.g. \PHPUnit_Framework_TestListener::startTest because the method \Illuminate\Foundation\Testing\TestCase::afterApplicationCreated isn't public => this PR changes this.

A concrete example what I'm doing: for every test in my Listener I'm registering a callback which in-depth analyzes the SQL statements performed. But I can only hook into DB::listen once the application is "started", as such I need to do this in the mentioned callbacks. But currently it's not directly possible to the visibility.

It's possible to workaround this but my understanding is that TestCase should be open in this regard to be more flexible, like in this scenario I described.

@taylorotwell taylorotwell merged commit 25c76ea into laravel:5.3 Sep 18, 2016
@GrahamCampbell GrahamCampbell changed the title [5.3][TEST] Make afterApplicationCreated() callback registration public [5.3] Make afterApplicationCreated() callback registration public Sep 18, 2016
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.

2 participants