title: Inconsistent output for PHP ReflectionMethod invoke() in PHPUnit
body: <p>I came across a strange case when using php class reflection in PHPUnit. Following is how I do in straight class, it produces "ChildClass" from get_called_class(), as I expected:</p>
  
  <pre><code>class ParentClass {
      static function funcA() {
          echo get_called_class() . PHP_EOL;
      }
  }
  
  class ChildClass extends ParentClass {
  }
  
  class MyTest {
      public function test() {
          $reflectionClass = new ReflectionClass('ChildClass');
          var_dump($reflectionClass);
          $reflectionClass-&gt;getMethod('funcA')-&gt;invoke(null);
      }
  }
  
  $object = new MyTest;
  $object-&gt;test();
  </code></pre>
  
  <p>It outputs:</p>
  
  <pre><code>object(ReflectionClass)#2 (1) {
    ["name"]=&gt;
    string(10) "ChildClass"
  }
  ChildClass
  </code></pre>
  
  <p>But if I wrap that in a PHPUnit test case, the get_called_class() echo "ParentClass". It definitely changed behavior of invoking method on Reflection class. Did I miss anything in PHPUnit, or PHP ReflectionClass itself?</p>
  
  <pre><code>class MyTest extends PHPUnit_Framework_TestCase {
      public function testReflection() {
          $reflectionClass = new ReflectionClass('ChildClass');
          var_dump($reflectionClass);
          $reflectionClass-&gt;getMethod('funcA')-&gt;invoke(null);
      }
  }
  </code></pre>
  
  <p>Here is the output, notice the last line, it shows "ParentClass"</p>
  
  <pre><code>PHPUnit 3.7.28 by Sebastian Bergmann.
  
  .class ReflectionClass#221 (1) {
    public $name =&gt;
    string(10) "ChildClass"
  }
  ParentClass
  </code></pre>