zenstruck / browser

A fluent interface for your Symfony functional tests.
MIT License
190 stars 18 forks source link

Test browser factory "options" array's #29

Closed kbond closed 2 years ago

kbond commented 3 years ago

I recently added the ability to pass options to the test browser factory methods (https://github.com/zenstruck/browser/commit/79e8130d5752dd9ccc688e61de02a8b0252fe7ea):

protected function pantherBrowser(array $options = [], array $kernelOptions = [], array $managerOptions = []): PantherBrowser
protected function httpBrowser(array $kernelOptions = [], array $pantherOptions = []): HttpBrowser
protected function kernelBrowser(array $options = []): KernelBrowser

I find all these different options confusing - what about just a single $options array for each:

protected function pantherBrowser(array $options = []): PantherBrowser
protected function httpBrowser(array $options = []): HttpBrowser
protected function kernelBrowser(array $options = []): KernelBrowser

The single $options could be passed to each place it's needed. I don't think there would be any issues with key conflicts or extra keys.

kbond commented 2 years ago

Decided to not do this. But #75 adds some docblocks to help with documentation.