title: How to test namespaced objects in Laravel 4 with phpunit
body: <p>I'm organizing my tests folder to reflect the namespaced objects and interfaces in my app. However, I've been running into nothing but trouble trying to maintain order while practicing TDD with namespaces! I'm completely at a loss of how to get all these pieces to play nice. Any help with this issue would be greatly appreciated!</p>
  
  <p>Structure:</p>
  
  <pre><code>app/ 
    Acme/ 
      Repositories/ 
        UserRepository.php 
      User.php
    tests/ 
      Acme/ 
        Repositories/ 
          UserRepositoryTest.php 
        UserTest.php
  </code></pre>
  
  <p>app/Acme/User.php</p>
  
  <pre><code>&lt;?php namespace Acme;
  
  use Eloquent;
  
  class User extends Eloquent {
  
      protected $guarded = array();
  
      public static $rules = array();
  }
  </code></pre>
  
  <p>app/tests/Acme/UserTest.php</p>
  
  <pre><code>&lt;?php
  
  use Acme\User;
  
  class UserTest extends TestCase {
  
      public function testCanBeLoaded()
      {
          $this-&gt;assertInstanceOf(User, new User);
      }
  }
  </code></pre>
  
  <p>PHPUnit result:</p>
  
  <pre><code>1) UserTest::testCanBeLoaded
  ErrorException: Use of undefined constant User - assumed 'User'
  </code></pre>