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 17:46:56 +0400
committerMichal Čihař <mcihar@suse.cz>2012-05-14 17:46:56 +0400
commit121b798f0e7e6ecae88ec08a289f0fd7bd66d4b2 (patch)
treef8216efa494937782a557b82842b6fc03c9a3a02 /test
parent1208be3d1a556cab6a39b1fc6cbe9294ba6cc17d (diff)
Split out checkPmaAbsoluteUri using dataProvider
Diffstat (limited to 'test')
-rw-r--r--test/classes/PMA_Config_test.php27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php
index 56b4c3fa5d..3d68b2baff 100644
--- a/test/classes/PMA_Config_test.php
+++ b/test/classes/PMA_Config_test.php
@@ -408,20 +408,33 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
}
/**
+ * Checks correcting of absolute URI
*
+ * @param string $real Real URI received
+ * @param string $expected Expected corrected URI
*
* @depends testCheckPmaAbsoluteUriEmpty
+ * @dataProvider absoluteUris
*/
- public function testCheckPmaAbsoluteUriNormal()
+ public function testCheckPmaAbsoluteUriNormal($real, $expected)
{
- $this->object->set('PmaAbsoluteUri', 'http://localhost/phpmyadmin/');
+ $this->object->set('PmaAbsoluteUri', $real);
$this->object->checkPmaAbsoluteUri();
- $this->assertEquals("http://localhost/phpmyadmin/", $this->object->get('PmaAbsoluteUri'));
-
- $this->object->set('PmaAbsoluteUri', 'http://localhost/phpmyadmin');
- $this->object->checkPmaAbsoluteUri();
- $this->assertEquals("http://localhost/phpmyadmin/", $this->object->get('PmaAbsoluteUri'), 'Expected trailing slash at the end of the phpMyAdmin uri');
+ $this->assertEquals($expected, $this->object->get('PmaAbsoluteUri'));
+ }
+ public function absoluteUris()
+ {
+ return array(
+ array(
+ 'http://localhost/phpmyadmin/',
+ 'http://localhost/phpmyadmin/',
+ ),
+ array(
+ 'http://localhost/phpmyadmin',
+ 'http://localhost/phpmyadmin/',
+ ),
+ );
}
/**