Replies: 1 comment 3 replies
-
Hi, yes the approach for getting the SF container is the same approach that you would use in PHPUnit etc. I have done something like this:
(no extensions required) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Apologies, this is more of a question than a report. If / when you enable Github discussions I'll happily move my question there.
I would like to start creating benchmarks for my code. To create these, I need to inject several services. I found the possibility to define services via the extension, however this means I need to recreate a lot of my configuration already defined in my symfony app, including configuration done by third party code in my vendor folder.
Is it possible to somehow inject the symfony container into my benchmarks, or register all services in the symfony container via the phpbench extension? I could not find anything on the subject, so I'm not sure this is a feasible / desirable request.
If it proves possible, I can give it a go and do a documentation PR. I see the following options. Maybe, in the extension, I can load the container via the XML file, the same as phpstan does in https://github.com/phpstan/phpstan-symfony?
Beta Was this translation helpful? Give feedback.
All reactions