title: How do I access private attributes in PHP?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/249664/best-practices-to-test-protected-methods-with-phpunit">Best practices to test protected methods with PHPUnit</a>  </p>
  </blockquote>
  
  
  
  <pre><code>class Footer
  {
    private $_isEnabled;
  
    public function __construct(){
      $this-&gt;_isEnabled = true;
    }
  
    public function disable(){
      $this-&gt;_isEnabled = false;
    }  
  }
  </code></pre>
  
  <p>When I am writing a unit test for the disable function after I set <code>_isEanabled</code> to false, I want to assert whether or not it is false.</p>
  
  <p>But how can I access <code>$_isEnabled</code>?</p>
  
  <p>This is my test function:</p>
  
  <pre><code>public function testDisable(){
    $footer = new Footer();
    $footer-&gt;disable();
    $this-&gt;assertFalse($footer-&gt;_isEnable);
  }
  </code></pre>