diff options
Diffstat (limited to 'engine/tests/api')
-rw-r--r-- | engine/tests/api/access_collections.php | 10 | ||||
-rw-r--r-- | engine/tests/api/entity_getter_functions.php | 2 | ||||
-rw-r--r-- | engine/tests/api/helpers.php | 16 | ||||
-rw-r--r-- | engine/tests/api/metadata.php | 9 | ||||
-rw-r--r-- | engine/tests/api/plugins.php | 5 |
5 files changed, 22 insertions, 20 deletions
diff --git a/engine/tests/api/access_collections.php b/engine/tests/api/access_collections.php index 1e61c45bb..0c37fa779 100644 --- a/engine/tests/api/access_collections.php +++ b/engine/tests/api/access_collections.php @@ -194,7 +194,7 @@ class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest { return $value; } - register_plugin_hook('access:collections:write', 'all', 'test_acl_access_hook'); + elgg_register_plugin_hook_handler('access:collections:write', 'all', 'test_acl_access_hook'); // enable security since we usually run as admin $ia = elgg_set_ignore_access(false); @@ -202,14 +202,16 @@ class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest { $this->assertTrue($result); $ia = elgg_set_ignore_access($ia); - unregister_plugin_hook('access:collections:write', 'all', 'test_acl_access_hook'); + elgg_unregister_plugin_hook_handler('access:collections:write', 'all', 'test_acl_access_hook'); + + delete_access_collection($acl_id); } // groups interface // only runs if the groups plugin is enabled because implementation is split between // core and the plugin. public function testCreateDeleteGroupACL() { - if (!is_plugin_enabled('groups')) { + if (!elgg_is_active_plugin('groups')) { return; } @@ -231,7 +233,7 @@ class ElggCoreAccessCollectionsTest extends ElggCoreUnitTest { } public function testJoinLeaveGroupACL() { - if (!is_plugin_enabled('groups')) { + if (!elgg_is_active_plugin('groups')) { return; } diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php index 59b48999c..e7906d3c8 100644 --- a/engine/tests/api/entity_getter_functions.php +++ b/engine/tests/api/entity_getter_functions.php @@ -855,7 +855,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest { public function testElggApiGettersEntityNoSubtype() { // create an entity we can later delete. - // order by time created and limit by 1 should == this entity. + // order by guid and limit by 1 should == this entity. $e = new ElggObject(); $e->save(); diff --git a/engine/tests/api/helpers.php b/engine/tests/api/helpers.php index 36d680d54..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'])); diff --git a/engine/tests/api/metadata.php b/engine/tests/api/metadata.php index d9113b68a..7897b8d47 100644 --- a/engine/tests/api/metadata.php +++ b/engine/tests/api/metadata.php @@ -75,16 +75,9 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { $this->assertIdentical($case_true, $case_false); - // check deprecated get_entities_from_metadata() function - $deprecated = get_entities_from_metadata('metaUnitTest', 'tested', '', '', 0, 10, 0, '', 0, FALSE, TRUE); - $this->assertIdentical($deprecated, $case_true); - - // check entity list - //$this->dump(list_entities_from_metadata('metaUnitTest', 'Tested', '', '', 0, 10, TRUE, TRUE, TRUE, FALSE)); - // clean up - $this->delete_metastrings(); $this->object->delete(); + $this->delete_metastrings(); } public function testElggGetMetadataCount() { diff --git a/engine/tests/api/plugins.php b/engine/tests/api/plugins.php index 72092b688..8f5f5dd1e 100644 --- a/engine/tests/api/plugins.php +++ b/engine/tests/api/plugins.php @@ -105,7 +105,6 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { array('type' => 'plugin', 'name' => 'facebook_connect', 'version' => 1.0), ), - 'admin_interface' => 'simple', 'activate_on_install' => true ); @@ -265,10 +264,6 @@ class ElggCorePluginsAPITest extends ElggCoreUnitTest { $this->assertEqual($this->manifest17->getConflicts(), array()); } - public function testElggPluginManifestGetAdminInterface() { - $this->assertEqual($this->manifest18->getAdminInterface(), 'simple'); - } - public function testElggPluginManifestGetActivateOnInstall() { $this->assertEqual($this->manifest18->getActivateOnInstall(), true); } |