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

Implement a application event dispatcher reset #126

Open
Jurigag opened this issue Aug 2, 2022 · 3 comments
Open

Implement a application event dispatcher reset #126

Jurigag opened this issue Aug 2, 2022 · 3 comments

Comments

@Jurigag
Copy link

Jurigag commented Aug 2, 2022

Feature Request

So, currently in laminas-test a reset of test is done just by initialization of whole application again which in big codebase can take a huge amount of time, with creating container, reading configs etc.

Most of other frameworks works pretty fine with typical request-response loop, like you can execute multiple request on application itself and it will return proper responses. Tried the same here when using laminas-test while keeping the same application instance - not possible, the second request to same endpoint doesn't go to the controller.

Not sure actually if this is a bug or feature request, but it could be good to somehow clear/reset event dispatcher of application without recreating and bootsraping whole container once again.

Q A
New Feature yes
RFC n/a
BC Break n/a
@Ocramius
Copy link
Member

Ocramius commented Aug 2, 2022

Resetting services is not really feasible, without making individual services resettable via proxies 🤔

@Xerkus
Copy link
Member

Xerkus commented Aug 9, 2022

At some point me and others in then zend framework community tried to use same application to handle multiple consecutive requests. We doscovered that application was leaking state between requests pretty badly in unpredictable manner.

I do not think application can be reliably reset for testing purposes for much the same reasons it couldn't be used for multiple requests.

@Ocramius
Copy link
Member

Ocramius commented Aug 9, 2022

Biggest issue being that the controller helpers and view helpers are stateful by design too.

Services being resettable is feasible with some work, but that would require expanding the laminas/laminas-servicemanager capabilities substantially.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants