title: Why am I getting this error? Fatal error: Class 'TestCase' not found
body: <p>Even though I have got the TestCase class included?</p>
  
  <pre><code>    &lt;?php
  
  require_once("PHPUnit/Autoload.php");
  require_once("PHPUnit/Framework/TestCase.php");
  require_once("PHPUnit/Framework/TestSuite.php");
  
  class WidgetSession {
      public function __construct($one, $two){}
      public function login() {}
      public function isLoggedIn() {return null;}
      public function getUser(){
          return new WidgetUser();
      }
  }
  
  class WidgetUser{
      public $first_name = "";
      public $last_name = "";
      public $email = "";
  
      public function isSalesPerson() {return null;}
      public function isSalesManager() {return null;}
  }
  
  class TestWidgetSession extends TestCase {
  
      private $_session;
      function setUp(){
          $dsn = array(
              'phptype' =&gt; "pgsql",
              'hostspec' =&gt; "localhost",
              'database' =&gt; "widgetworld",
              'username' =&gt; "wuser",
              'password' =&gt; "foobar"
          );
          $this-&gt;_session = new WidgetSession($dsn, true);
      }
  
      function testValidLogin(){
          $this-&gt;_session-&gt;login("ed", "12345");
          $this-&gt;assertEqual(true, $this-&gt;_session-&gt;isLoggedIn());
      }
  
      function testInvalidLogin(){
          $this-&gt;_session-&gt;login("ed", "54321"); //fail
          $this-&gt;assertEquals(false, $this-&gt;_session-&gt;isLoggedIn());
      }
  
      function testUser(){
          $user = $this-&gt;_session-&gt;getUser();
          $this-&gt;assertEquals("Lecky Thompson", $user-&gt;last_name);
          $this-&gt;assertEquals("Ed", $user-&gt;first_name);
          $this-&gt;assertEquals("ed@lecky-thompson.com", $user-&gt;email);
      }
  
      function testAuthorization(){
          $user = $this-&gt;_session-&gt;getUser();
          $this-&gt;assertEquals("Sales Person", $user-&gt;role);
          $this-&gt;assertEquals(true, $user-&gt;isSalesPerson());
          $this-&gt;assertEquals(false, $user-&gt;isSalesManager());
          $this-&gt;assertEquals(false, $user-&gt;isAccountant());
      }
  }
  
  $suite = new TestSuite;
  $suite-&gt;addTest(new TestWidgetSession("testValidLogin"));
  $suite-&gt;addTest(new TestWidgetSession("testInvalidLogin"));
  $suite-&gt;addTest(new TestWidgetSession("testUser"));
  $suite-&gt;addTest(new TestWidgetSession("testAuthorization"));
  $testRunner = new TestRunner();
  $testRunner-&gt;run($suite);
  ?&gt;
  </code></pre>