title: Laravel 5.1 unit testing authenticated user
body: <p>So after reading through the documentation a couple of times, I'm still confused as to how you can authenticate as a user for unit testing in 5.1. Previously in 4.2 you could use:</p>
  
  <pre><code>$user = new User(array('name' =&gt; 'John'));
  $this-&gt;be($user);
  </code></pre>
  
  <p>In 5.1 the example given is:</p>
  
  <pre><code>$user = factory('App\User')-&gt;create();
  $this-&gt;actingAs($user)
  </code></pre>
  
  <p>Isn't the factory just returning a User?  If I attempt to use <code>$user = new User(array('name' =&gt; 'John'));</code> I get an error because <code>actingAs</code> expects an <code>Authenticatable</code>. So how do you authenticate as an existing user?</p>