common.phpt 807 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. MySQL
  3. --SKIPIF--
  4. <?php # vim:ft=php
  5. if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) print 'skip not loaded';
  6. ?>
  7. --REDIRECTTEST--
  8. # magic auto-configuration
  9. $config = array(
  10. 'TESTS' => __DIR__.'/ext/pdo/tests'
  11. );
  12. if (false !== getenv('PDO_MYSQL_TEST_DSN')) {
  13. # user set them from their shell
  14. $config['ENV']['PDOTEST_DSN'] = getenv('PDO_MYSQL_TEST_DSN');
  15. $config['ENV']['PDOTEST_USER'] = getenv('PDO_MYSQL_TEST_USER');
  16. $config['ENV']['PDOTEST_PASS'] = getenv('PDO_MYSQL_TEST_PASS');
  17. if (false !== getenv('PDO_MYSQL_TEST_ATTR')) {
  18. $config['ENV']['PDOTEST_ATTR'] = getenv('PDO_MYSQL_TEST_ATTR');
  19. }
  20. } else {
  21. $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test';
  22. $config['ENV']['PDOTEST_USER'] = 'root';
  23. $config['ENV']['PDOTEST_PASS'] = '';
  24. }
  25. return $config;