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

Simplify client instance and loginAs #401

Open
soullivaneuh opened this issue Feb 28, 2018 · 2 comments
Open

Simplify client instance and loginAs #401

soullivaneuh opened this issue Feb 28, 2018 · 2 comments
Labels

Comments

@soullivaneuh
Copy link
Contributor

soullivaneuh commented Feb 28, 2018

Currently, if we want to use an another user for auth, we have to do this:

public function testPaymentsAreNotShownOnSearch()
{
    $this->loginAs($this->getReference('user_super_admin'));
    $client = $this->makeClient();
}

Why not make makeClient accepting UserInterface instances? And then we can simplify the call like this:

public function testPaymentsAreNotShownOnSearch()
{
    $client = $this->makeClient($this->getReference('user_super_admin'));
}

And same for fetchContent.

What do you think?

Note: We may also need #345.

@Jean85
Copy link
Contributor

Jean85 commented Feb 28, 2018

How would this work with custom logins and other custom stuff that the end user may be interested in doing?

@soullivaneuh
Copy link
Contributor Author

@Jean85 What do you mean? Do you have an example of what would be problematic?

Note: I don't say to remove the $this->makeClient(true) method, both should be possible.

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

No branches or pull requests

3 participants