zendframework / zend-servicemanager

ServiceManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
188 stars 89 forks source link

Test suite does not cover multiple idempotency scenarios around `ServiceManager#has()` and `ServiceManager#get()` #236

Closed Ocramius closed 6 years ago

Ocramius commented 6 years ago

From the original issue by @fhein (#235):

I got aware of this issue, when I created a feature branch, applied some changes, ran the tests witch result OK. Then I ran the benchmarks and I got errors not related to phpbench but related to the ServiceManager.

Tracking this down I found, that the benchmarks do things that are not tested by phpunit. Example: get() the same service twice. Or build() a service, then get() the same service. Or has() a service, then get() it. Just to mention the trivial cases.

ServiceManager can (and probably will) change state when any of this APIs (build(),get(), has()) gets called. There are no tests present to cover that state changes. Not completely true, there are some, but their intention is not to track the state changes. But fortunately they do.

fhein commented 6 years ago

See #237.

Ocramius commented 6 years ago

@fhein awesome, thanks! Will try prioritising it in the morning 👍

fhein commented 6 years ago

Thank YOU! :+1:

PowerKiKi commented 6 years ago

This issue has been solved in #237 and should probably be closed now.