title: PDOException: could not find driver when using phpunit
body: <p>I am starting to use laravel 4 and I am trying to start using unit tests so I can make my live easier. Well as all of you will guess my development hasn't become easier after trying phpunit tests. The simple tests are well, easy but when the things start to get a bit more complicated  they does not go as I though they will. </p>
  
  <p>The problem is I have conducted simple tests but I get some strange error <code>PDOException: could not find driver</code>. I have read a few articles and post on this topic but nothing solved my problem. I have installed <code>php5-mysql</code> and when I call <code>php -m</code> it says that I have both PDO and pdo_mysql. The actual command I use is <code>php -m |grep -i "pdo"</code> and the output is: </p>
  
  <pre><code>PDO
  pdo_mysql
  </code></pre>
  
  <p>Well I've tried to actualy test PDOException class in the browser. For that purpose I have change the mysql user password to incorrect one and tested what will happen in <strong>artisan server</strong> (called with command <code>php artisan serve</code> ---> <code>http://localhost:8000/</code>). In the browser everything works as a charm but when I try to call ``phpunit` in the <strong>console</strong> the result is not the same. </p>
  
  <p>I have tried to see if webserver and cli have different configuration files but it turnout that the files are identical. The configuration files that I have compared are:</p>
  
  <p><strong>for the web server</strong></p>
  
  <pre><code>/etc/php5/apache2/conf.d/20-pdo_mysql.ini
  /etc/php5/apache2/conf.d/05-opcache.ini
  /etc/php5/apache2/conf.d/20-json.ini
  /etc/php5/apache2/conf.d/20-mysql.ini
  /etc/php5/apache2/conf.d/20-mysqli.ini
  /etc/php5/apache2/conf.d/10-pdo.ini
  /etc/php5/apache2/conf.d/20-mcrypt.ini
  /etc/php5/apache2/conf.d/20-curl.ini
  /etc/php5/apache2/php.ini
  </code></pre>
  
  <p><strong>for command line</strong></p>
  
  <pre><code>/etc/php5/cli/conf.d/20-pdo_mysql.ini
  /etc/php5/cli/conf.d/05-opcache.ini
  /etc/php5/cli/conf.d/20-json.ini
  /etc/php5/cli/conf.d/20-mysql.ini
  /etc/php5/cli/conf.d/20-mysqli.ini
  /etc/php5/cli/conf.d/10-pdo.ini
  /etc/php5/cli/conf.d/20-mcrypt.ini
  /etc/php5/cli/conf.d/20-curl.ini
  /etc/php5/cli/php.ini
  </code></pre>
  
  <p>to compare them I user the diff command like so <code>diff -s /path/to/file1 /path/to/file2</code>.</p>
  
  <p>The errors look like this:</p>
  
  <pre><code>1) ExampleTest::testBasicExample
  PDOException: could not find driver
  
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:22
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:59
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:47
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:127
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:63
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:167
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php:135
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:366
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:93
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:56
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Command.php:108
  /var/www/smlsspd/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Command.php:96
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Console/Application.php:96
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Foundation/Artisan.php:57
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
  /var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
  /var/www/smlsspd/app/tests/TestCase.php:70
  /var/www/smlsspd/app/tests/TestCase.php:70
  /var/www/smlsspd/app/tests/TestCase.php:46
  phar:///var/www/smlsspd/phpunit.phar/phpunit/TextUI/Command.php:179
  phar:///var/www/smlsspd/phpunit.phar/phpunit/TextUI/Command.php:132
  </code></pre>
  
  <p>Can you give me a hint or solution to this problem? </p>
  
  <p>Thank you for your time :)</p>