aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/api
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 21:02:30 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-12 21:02:30 +0000
commit9b2c527e6cea1ce81293324f1783bc78225ada0f (patch)
tree8a9b1b1527d422e26d61430df6afcd46e5cf593b /engine/tests/api
parentd4cab20408bcfa394ca978a16e09e6fd84539350 (diff)
downloadelgg-9b2c527e6cea1ce81293324f1783bc78225ada0f.tar.gz
elgg-9b2c527e6cea1ce81293324f1783bc78225ada0f.tar.bz2
Refs #3091 registering js and css support priority though does not maintain registration order if items have equal priority
git-svn-id: http://code.elgg.org/elgg/trunk@8669 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests/api')
-rw-r--r--engine/tests/api/helpers.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php
index b8cf96900..b7057220b 100644
--- a/engine/tests/api/helpers.php
+++ b/engine/tests/api/helpers.php
@@ -104,9 +104,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
global $CONFIG;
// specify name
- $result = elgg_register_js('key', '//test1.com', 'footer');
+ $result = elgg_register_js('key', 'http://test1.com', 'footer');
$this->assertTrue($result);
- $this->assertIdentical('//test1.com', $CONFIG->externals['js']['footer']['key']);
+ $this->assertIdentical('http://test1.com', $CONFIG->externals['js']['footer']['key']->url);
// send a bad url
$result = elgg_register_js();
@@ -120,9 +120,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
global $CONFIG;
// specify name
- $result = elgg_register_css('key', '//test1.com');
+ $result = elgg_register_css('key', 'http://test1.com');
$this->assertTrue($result);
- $this->assertIdentical('//test1.com', $CONFIG->externals['css']['head']['key']);
+ $this->assertIdentical('http://test1.com', $CONFIG->externals['css']['head']['key']->url);
}
/**
@@ -131,7 +131,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
public function testElggUnregisterJS() {
global $CONFIG;
- $urls = array('id1' => '//url1.com', 'id2' => '//url2.com', 'id3' => '//url3.com');
+ $base = trim(elgg_get_site_url(), "/");
+
+ $urls = array('id1' => "$base/urla", 'id2' => "$base/urlb", 'id3' => "$base/urlc");
foreach ($urls as $id => $url) {
elgg_register_js($id, $url);
}
@@ -142,11 +144,11 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$result = elgg_unregister_js('id1');
$this->assertFalse($result);
- $result = elgg_unregister_js('', '//url2.com');
+ $result = elgg_unregister_js('', 'does_not_exist');
$this->assertFalse($result);
$result = elgg_unregister_js('id2');
- $this->assertIdentical($urls['id3'], $CONFIG->externals['js']['head']['id3']);
+ $this->assertIdentical($urls['id3'], $CONFIG->externals['js']['head']['id3']->url);
}
/**
@@ -157,9 +159,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$base = trim(elgg_get_site_url(), "/");
- $urls = array('id1' => "$base/id1", 'id2' => "$base/id2", 'id3' => "$base/id3");
+ $urls = array('id1' => "$base/urla", 'id2' => "$base/urlb", 'id3' => "$base/urlc");
foreach ($urls as $id => $url) {
- elgg_register_js($url, $id);
+ elgg_register_js($id, $url);
}
$js_urls = elgg_get_js('head');