LiipFunctionalTestBundle
LiipFunctionalTestBundle copied to clipboard
Simplify client instance and loginAs
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.
How would this work with custom logins and other custom stuff that the end user may be interested in doing?
@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.