title: PHPUnit, Fatal error: Class 'mysqli' not found
body: <p>I have a similar to issue to that described <a href="https://stackoverflow.com/questions/10191869/with-phpunit-class-mysqli-is-not-found">here</a>:</p>
  
  <p>Everything works as I would expect; my code accesses the database and prints output irrespective of whether I run in from my command line interface or from the web browser. Same result. If I run it in Eclipse with PHPUnit, I get an error:</p>
  
  <pre><code>Multiple annotations found at this line:
      - Fatal error: Class 'mysqli' not found
      - Occurrence of 'connection'
  </code></pre>
  
  <p>Which points at the following line:</p>
  
  <p>This code prints out 'Yes'.</p>
  
  <pre><code>$connection = new \mysqli(HOST, USER, PASS, DATABASE);
  
  if (extension_loaded('mysqli')) {
      echo "Yes";
  }
  else {
      echo "No";
  }
  </code></pre>
  
  <p>One more thing to point out is that I'm using my own namespace in the class where the above code is located. My unit tests are in the global namespace.</p>
  
  <p>I've followed the steps in the URL above but, alas, to no avail. :(</p>
  
  <p>Running this on the command prompt gives no errors:</p>
  
  <pre><code>php -r "new mysqli();"
  </code></pre>
  
  <p>Please could someone help me understand the issue here?</p>