title: Setting up PHPUnit on OSX
body: <p>Though I'm sure others have eventually managed to figure this out, I've been following the various documentation out there and have been having a heck of a rough time of it.</p>
  
  <p><a href="http://www.phpunit.de/manual/current/en/installation.html" rel="noreferrer">http://www.phpunit.de/manual/current/en/installation.html</a></p>
  
  <p>Makes it sound pretty easy.  However depending on your setup, you might be going down a rabbit hole.</p>
  
  <p>PEAR for example must be of a version higher than 1.8.1.  I had 1.8.0 at the time, so I went to find out how to update PEAR</p>
  
  <pre><code>PEAR upgrade-all
  </code></pre>
  
  <p>Gives an error.  No access.</p>
  
  <pre><code>sudo PEAR upgrade-all
  </code></pre>
  
  <p>Works, but upgrades the PEAR install owned by the user 'sudo' (and not your primary account... or something like that, short version is 5that it plain don't work)</p>
  
  <pre><code>cd ~
  pico .bash_profile
  </code></pre>
  
  <p>add</p>
  
  <pre><code>export PATH=/usr/local/bin:$PATH
  </code></pre>
  
  <p>give you the correct PEAR when you type PEAR, you're finally ready for step 1 of the install PHPUnit instructions.</p>
  
  <pre><code>pear channel-discover pear.phpunit.de
  </code></pre>
  
  <p>Error.  You don't have access to /usr/local/temp</p>
  
  <pre><code>sudo chmod 777 /usr/local/temp
  </code></pre>
  
  <p>Error. You don't have access to /usr/local/temp/channel.xml</p>
  
  <pre><code>sudo chmod 777 /usr/local/temp/channel.xml
  pear channel-discover pear.phpunit.de
  </code></pre>
  
  <p>Error.</p>
  
  <pre><code>Registry directory is not writeable by the current user
  </code></pre>
  
  <p>BUT I'M ON A MAC!</p>
  
  <pre><code>/sigh
  /facepalm
  /tears
  </code></pre>
  
  <p>I've actually got a "working copy" of phpunit on my machine.  (YAY!) the odd problem is that 
   it only works when I type phpunit from one specific folder</p>
  
  <pre><code>cd /usr/local/PEAR
  phpunit
  </code></pre>
  
  <p>^^ WORKS</p>
  
  <pre><code>cd ~
  phpunit
  </code></pre>
  
  <p>^^ Returns </p>
  
  <pre><code>Warning: require_once(PHPUnit/Util/Filter.php): failed to open stream: No such file or directory in /usr/local/bin/phpunit on line 46
  
  Fatal error: require_once(): Failed opening required 'PHPUnit/Util/Filter.php' (include_path='.:/usr/lib/php') in /usr/local/bin/phpunit on line 46
  </code></pre>
  
  <p>So close yet so far... I'm wondering if anyone has some input on getting this guy working right?</p>