2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * tests for environment like OS, PHP, modules, ...
6 * @package PhpMyAdmin-test
12 require_once 'config.sample.inc.php';
17 * @package PhpMyAdmin-test
19 class Environment_Test
extends PHPUnit_Framework_TestCase
26 public function testPhpVersion()
29 version_compare('5.3', phpversion(), '<='),
30 'phpMyAdmin requires PHP 5.3 or above'
35 * Tests MySQL connection
39 public function testMySQL()
43 "mysql:host=" . $GLOBALS['TESTSUITE_SERVER'],
44 $GLOBALS['TESTSUITE_USER'],
45 $GLOBALS['TESTSUITE_PASSWORD']
49 "Error when trying to connect to database"
52 $pdo->exec("SHOW DATABASES;");
56 'Error trying to show tables for database'
58 } catch (Exception
$e) {
59 $this->markTestSkipped("Error: " . $e->getMessage());
62 // Check id MySQL server is 5 version
64 "/^(\d+)?\.(\d+)?\.(\*|\d+)/",
65 $pdo->getAttribute(constant("PDO::ATTR_SERVER_VERSION")),
68 $this->assertEquals(5, $version_parts[1]);