title: phpunit runs test twice - gets two answers. Why?
body: <p>This is my phpunit test file</p>
  
  <pre><code>&lt;?php // DemoTest - test to prove the point
  
  function __autoload($className) {
      //  pick file up from current directory
      $f = $className.'.php'; 
      require_once $f;
  }
  
  class DemoTest extends PHPUnit_Framework_TestCase {
      // call same test twice - det different results 
      function test01() {
          $this-&gt;controller = new demo();
          ob_start();
          $this-&gt;controller-&gt;handleit();
          $result = ob_get_clean();  
          $expect = 'Actions is an array';
          $this-&gt;assertEquals($expect,$result);
      }
  
      function test02() {
          $this-&gt;test01();
      }
  }
  ?&gt;
  </code></pre>
  
  <p>This is the file under test</p>
  
  <pre><code>&lt;?php // demo.php
  global $actions;
  $actions=array('one','two','three');
  class demo {
      function handleit() {
          global $actions;
          if (is_null($actions)) {
              print "Actions is null";
          } else {
              print('Actions is an array');
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p>The result is that the second test fails because $actions is null. </p>
  
  <p>My question is - why don't I get the same results for the two tests? </p>
  
  <p>Is this a bug in phpunit or it is my understanding of php? </p>