aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/api/helpers.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/tests/api/helpers.php')
-rw-r--r--engine/tests/api/helpers.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php
index ee2e64cfe..f48f91faf 100644
--- a/engine/tests/api/helpers.php
+++ b/engine/tests/api/helpers.php
@@ -63,6 +63,8 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$this->assertFalse(elgg_instanceof($bad_entity));
$this->assertFalse(elgg_instanceof($bad_entity, 'object'));
$this->assertFalse(elgg_instanceof($bad_entity, 'object', 'test_subtype'));
+
+ remove_subtype('object', 'test_subtype');
}
/**
@@ -72,7 +74,13 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$conversions = array(
'http://example.com' => 'http://example.com',
'https://example.com' => 'https://example.com',
+ 'http://example-time.com' => 'http://example-time.com',
+
'//example.com' => '//example.com',
+ 'ftp://example.com/file' => 'ftp://example.com/file',
+ 'mailto:brett@elgg.org' => 'mailto:brett@elgg.org',
+ 'javascript:alert("test")' => 'javascript:alert("test")',
+ 'app://endpoint' => 'app://endpoint',
'example.com' => 'http://example.com',
'example.com/subpage' => 'http://example.com/subpage',
@@ -166,7 +174,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$this->assertFalse(isset($CONFIG->externals_map['js']['id1']));
foreach ($elements as $element) {
- $this->assertFalse($element->name == 'id1');
+ if (isset($element->name)) {
+ $this->assertFalse($element->name == 'id1');
+ }
}
$result = elgg_unregister_js('id1');
@@ -180,7 +190,9 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$this->assertFalse(isset($CONFIG->externals_map['js']['id2']));
foreach ($elements as $element) {
- $this->assertFalse($element->name == 'id2');
+ if (isset($element->name)) {
+ $this->assertFalse($element->name == 'id2');
+ }
}
$this->assertTrue(isset($CONFIG->externals_map['js']['id3']));
@@ -204,7 +216,7 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
$this->assertTrue($result);
$js_urls = elgg_get_loaded_js('footer');
- $this->assertIdentical(array('http://test1.com'), $js_urls);
+ $this->assertIdentical(array(500 => 'http://test1.com'), $js_urls);
}
/**
@@ -227,9 +239,10 @@ class ElggCoreHelpersTest extends ElggCoreUnitTest {
}
$js_urls = elgg_get_loaded_js('head');
- $this->assertIdentical($js_urls[0], $urls['id1']);
- $this->assertIdentical($js_urls[1], $urls['id2']);
- $this->assertIdentical($js_urls[2], $urls['id3']);
+
+ $this->assertIdentical($js_urls[500], $urls['id1']);
+ $this->assertIdentical($js_urls[501], $urls['id2']);
+ $this->assertIdentical($js_urls[502], $urls['id3']);
$js_urls = elgg_get_loaded_js('footer');
$this->assertIdentical(array(), $js_urls);