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';
14 use PHPUnit\Framework\TestCase
;
20 * @package PhpMyAdmin-test
22 class Environment_Test
extends TestCase
29 public function testPhpVersion()
32 version_compare('5.5', phpversion(), '<='),
33 'phpMyAdmin requires PHP 5.5 or above'
38 * Tests MySQL connection
42 public function testMySQL()
46 "mysql:host=" . $GLOBALS['TESTSUITE_SERVER'],
47 $GLOBALS['TESTSUITE_USER'],
48 $GLOBALS['TESTSUITE_PASSWORD']
52 "Error when trying to connect to database"
55 $pdo->exec("SHOW DATABASES;");
59 'Error trying to show tables for database'
61 } catch (Exception
$e) {
62 $this->markTestSkipped("Error: " . $e->getMessage());
65 // Check id MySQL server is 5 version
67 "/^(\d+)?\.(\d+)?\.(\*|\d+)/",
68 $pdo->getAttribute(constant("PDO::ATTR_SERVER_VERSION")),
71 $this->assertEquals(5, $version_parts[1]);