title: phpunit - mockbuilder - set mock object internal property
body: <p>Is it possible to create a mock object with disabled constructor and manually setted protected properties?</p>
  
  <p>Here is an idiotic example:</p>
  
  <pre><code>class A {
      protected $p;
      public function __construct(){
          $this-&gt;p = 1;
      }
  
      public function blah(){
          if ($this-&gt;p == 2)
              throw Exception();
      }
  }
  
  class ATest extend bla_TestCase {
      /** 
          @expectedException Exception
      */
      public function testBlahShouldThrowExceptionBy2PValue(){
          $mockA = $this-&gt;getMockBuilder('A')
              -&gt;disableOriginalConstructor()
              -&gt;getMock();
          $mockA-&gt;p=2; //this won't work because p is protected, how to inject the p value?
          $mockA-&gt;blah();
      }
  }
  </code></pre>
  
  <p>So I wanna inject the p value which is protected, so I can't. Should I define setter or IoC, or I can do this with phpunit?</p>