How to log in in an acceptance test without actually navigating to the login page and entering your credentials?
<p>In functional tests for Yii2, there is a method <code>amLoggedInAs($user)</code></p>

<pre><code>$I-&gt;amLoggedInAs(
    User::find()-&gt;where('id = 1')-&gt;one()
);
</code></pre>

<p>But for acceptance tests, there is no such method. Most of my tests require the user to be logged in, and the only way I see to log in is to programmatically navigate to the login page and enter your credentials, which is going to be quite time consuming if repeated for every test.</p>

<p>How can I log in during an acceptance test without going to the login page? Actually, I would expect to see <code>amLoggedInAs($user)</code> in <code>AcceptanceTester</code> as well as in <code>FunctionalTester</code>.</p>