]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added some more unit tests for elgg_normalize_url
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 07:20:20 +0000 (07:20 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 14 Nov 2010 07:20:20 +0000 (07:20 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7310 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/tests/api/helpers.php

index 565cf054a58d403975dcbf0cd27a13419b76edc0..46ff3ac1b43daedf9b8074358ab2e06b3fb053fe 100644 (file)
@@ -69,30 +69,34 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
         */
        public function testElggNormalizeURL() {
                $conversions = array(
-                       'http://example.com' => 'http://example.com', 
-                       'https://example.com' => 'https://example.com', 
+                       'http://example.com' => 'http://example.com',
+                       'https://example.com' => 'https://example.com',
                        '//example.com' => '//example.com',
-               
+
                        'example.com' => 'http://example.com',
                        'example.com/subpage' => 'http://example.com/subpage',
-               
-                       'pg/page/handler' => elgg_get_site_url().'pg/page/handler',
-                       'mod/plugin/file.php' => elgg_get_site_url().'mod/plugin/file.php',
-                       'rootfile.php' => elgg_get_site_url().'rootfile.php',
-                       'rootfile.php?setting=setting' => elgg_get_site_url().'rootfile.php?setting=setting',
-               
-                       '/pg/page/handler' => elgg_get_site_url().'pg/page/handler',
-                       '/mod/plugin/file.php' => elgg_get_site_url().'mod/plugin/file.php',
-                       '/rootfile.php' => elgg_get_site_url().'rootfile.php',
-                       '/rootfile.php?setting=setting' => elgg_get_site_url().'rootfile.php?setting=setting',
+
+                       'pg/page/handler' =>                elgg_get_site_url() . 'pg/page/handler',
+                       'pg/page/handler?p=v&p2=v2' =>      elgg_get_site_url() . 'pg/page/handler?p=v&p2=v2',
+                       'mod/plugin/file.php' =>            elgg_get_site_url() . 'mod/plugin/file.php',
+                       'mod/plugin/file.php?p=v&p2=v2' =>  elgg_get_site_url() . 'mod/plugin/file.php?p=v&p2=v2',
+                       'rootfile.php' =>                   elgg_get_site_url() . 'rootfile.php',
+                       'rootfile.php?p=v&p2=v2' =>         elgg_get_site_url() . 'rootfile.php??p=v&p2=v2',
+
+                       '/pg/page/handler' =>               elgg_get_site_url() . 'pg/page/handler',
+                       '/pg/page/handler?p=v&p2=v2' =>     elgg_get_site_url() . 'pg/page/handler?p=v&p2=v2',
+                       '/mod/plugin/file.php' =>           elgg_get_site_url() . 'mod/plugin/file.php',
+                       '/mod/plugin/file.php?p=v&p2=v2' => elgg_get_site_url() . 'mod/plugin/file.php?p=v&p2=v2',
+                       '/rootfile.php' =>                  elgg_get_site_url() . 'rootfile.php',
+                       '/rootfile.php?p=v&p2=v2' =>        elgg_get_site_url() . 'rootfile.php??p=v&p2=v2',
                );
-               
+
                foreach ($conversions as $input => $output) {
                        $this->assertIdentical($output, elgg_normalize_url($input));
                }
        }
-       
-       
+
+
        /**
         * Test elgg_register_js()
         */
@@ -129,7 +133,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
                $result = elgg_register_css('//test2.com');
                $this->assertTrue($result);
                $this->assertIdentical('//test2.com', $CONFIG->externals['css']['head'][1]);
-               
+
                // send a bad url
                $result = elgg_register_js();
                $this->assertFalse($result);