Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichal Čihař <mcihar@suse.cz>2012-05-14 18:15:58 +0400
committerMichal Čihař <mcihar@suse.cz>2012-05-14 18:15:58 +0400
commit2a7358c9ab182d0d1a699442cdcd614ff050f0bd (patch)
tree56375a0a567ac2cc02d87e099df21eddebf1293b /test
parent1b1f501ac8477d8a1f687c27247b76f17be77814 (diff)
Rewrite another test using dataProvider
Diffstat (limited to 'test')
-rw-r--r--test/classes/PMA_Config_test.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php
index aaa78b8b4d..93fcfd7130 100644
--- a/test/classes/PMA_Config_test.php
+++ b/test/classes/PMA_Config_test.php
@@ -226,19 +226,36 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
}
- public function testCheckWebServer()
+ /**
+ * Web server detection test
+ *
+ * @param string $server Server indentification
+ * @param boolean $iis Whether server should be detected as IIS
+ *
+ * @dataProvider serverNames
+ */
+ public function testCheckWebServer($server, $iis)
{
- $_SERVER['SERVER_SOFTWARE'] = "Microsoft-IIS 7.0";
+ $_SERVER['SERVER_SOFTWARE'] = $server;
$this->object->checkWebServer();
- $this->assertEquals(1, $this->object->get('PMA_IS_IIS'));
-
- $_SERVER['SERVER_SOFTWARE'] = "Apache/2.2.17";
- $this->object->checkWebServer();
- $this->assertEquals(0, $this->object->get('PMA_IS_IIS'));
-
+ $this->assertEquals($iis, $this->object->get('PMA_IS_IIS'));
unset($_SERVER['SERVER_SOFTWARE']);
}
+ public function serverNames()
+ {
+ return array(
+ array(
+ "Microsoft-IIS 7.0",
+ 1,
+ ),
+ array(
+ "Apache/2.2.17",
+ 0,
+ ),
+ );
+ }
+
public function testCheckWebServerOs()
{
$this->object->checkWebServerOs();