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.2', phpversion(), '<='),
30 'phpMyAdmin requires PHP 5.2 or above'
35 * Tests MySQL connection
39 public function testMySQL()
43 "mysql:host=" . TESTSUITE_SERVER
. ";dbname=" . TESTSUITE_DATABASE
,
49 "Error when trying to connect to database"
52 //$pdo->beginTransaction();
53 $test = $pdo->exec("SHOW TABLES;");
58 '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]);
75 * Test of session handling
79 * @todo Think about this test
81 public function testSession()
83 $this->markTestIncomplete();