diff options
author | Michal Čihař <mcihar@suse.cz> | 2012-05-14 17:46:56 +0400 |
---|---|---|
committer | Michal Čihař <mcihar@suse.cz> | 2012-05-14 17:46:56 +0400 |
commit | 121b798f0e7e6ecae88ec08a289f0fd7bd66d4b2 (patch) | |
tree | f8216efa494937782a557b82842b6fc03c9a3a02 /test | |
parent | 1208be3d1a556cab6a39b1fc6cbe9294ba6cc17d (diff) |
Split out checkPmaAbsoluteUri using dataProvider
Diffstat (limited to 'test')
-rw-r--r-- | test/classes/PMA_Config_test.php | 27 |
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/', + ), + ); } /** |