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

How to "fake" mobile in tests? #76

Open
garak opened this issue Sep 4, 2015 · 2 comments
Open

How to "fake" mobile in tests? #76

garak opened this issue Sep 4, 2015 · 2 comments

Comments

@garak
Copy link

garak commented Sep 4, 2015

I need to test a portion of code where isMobile() method is used, so I need to get two different cases, true and false.
How can I do it?
TIA

@sagikazarmark
Copy link

👍

I also would like to get some intel.

My idea: either in config or query param (not device_view) set the desired view (not device type, view). Catch it in a listener, and set the view in the DeviceView service. The use the device view service or twig functions.

@adrienbrault
Copy link

I think you can do that with the device_view cookie https://github.com/suncat2000/MobileDetectBundle/blob/master/Helper/DeviceView.php#L36

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

No branches or pull requests

3 participants