title: PHPunit and getopt
body: <p>I'm trying to test a component that uses a third party library which makes use of getopt to retrieve command line arguments.</p>
  
  <p>Is there any way I can get this working within PHPunit?</p>
  
  <p>I've tried inserting this prior to the component call:</p>
  
  <pre><code>$args = explode( ' ', 'scriptName -q staging_to_xxx -w 250 -c 500' );
  $_SERVER['argv'] = $args;
  </code></pre>
  
  <p>But that doesn't work.</p>