aboutsummaryrefslogtreecommitdiff
path: root/engine/tests
diff options
context:
space:
mode:
Diffstat (limited to 'engine/tests')
-rw-r--r--engine/tests/api/access_collections.php8
-rw-r--r--engine/tests/api/helpers.php8
-rw-r--r--engine/tests/api/metadata.php7
-rw-r--r--engine/tests/objects/entities.php12
-rw-r--r--engine/tests/objects/users.php23
-rw-r--r--engine/tests/regression/trac_bugs.php4
6 files changed, 18 insertions, 44 deletions
diff --git a/engine/tests/api/access_collections.php b/engine/tests/api/access_collections.php
index 1e61c45bb..bc5408546 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,14 @@ 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');
}
// 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 +231,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/helpers.php b/engine/tests/api/helpers.php
index 36d680d54..3f41400c8 100644
--- a/engine/tests/api/helpers.php
+++ b/engine/tests/api/helpers.php
@@ -166,7 +166,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 +182,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..208024e65 100644
--- a/engine/tests/api/metadata.php
+++ b/engine/tests/api/metadata.php
@@ -75,13 +75,6 @@ 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();
diff --git a/engine/tests/objects/entities.php b/engine/tests/objects/entities.php
index c04bc60ff..c0a7b96b3 100644
--- a/engine/tests/objects/entities.php
+++ b/engine/tests/objects/entities.php
@@ -125,7 +125,7 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
$this->assertIdentical(FALSE, elgg_get_annotations(array('guid' => $this->entity->getGUID(), 'type' => 'site', 'subtype' => 'fail')));
// clear annotation
- $this->assertTrue($this->entity->clearAnnotations());
+ $this->assertTrue($this->entity->deleteAnnotations());
$this->assertEqual($this->entity->countAnnotations('non_existent'), 0);
$this->assertIdentical(array(), elgg_get_annotations(array('guid' => $this->entity->getGUID())));
@@ -226,8 +226,8 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
}
public function testElggEntityMetadata() {
- // let's delte a non-existent metadata
- $this->assertFalse($this->entity->clearMetaData('important'));
+ // let's delete a non-existent metadata
+ $this->assertFalse($this->entity->deleteMetadata('important'));
// let's add the meatadata
$this->assertTrue($this->entity->important = 'indeed!');
@@ -236,16 +236,16 @@ class ElggCoreEntityTest extends ElggCoreUnitTest {
// test deleting incorrectly
// @link http://trac.elgg.org/ticket/2273
- $this->assertFalse($this->entity->clearMetaData('impotent'));
+ $this->assertFalse($this->entity->deleteMetadata('impotent'));
$this->assertEqual($this->entity->important, 'indeed!');
// get rid of one metadata
$this->assertEqual($this->entity->important, 'indeed!');
- $this->assertTrue($this->entity->clearMetaData('important'));
+ $this->assertTrue($this->entity->deleteMetadata('important'));
$this->assertEqual($this->entity->important, '');
// get rid of all metadata
- $this->assertTrue($this->entity->clearMetaData());
+ $this->assertTrue($this->entity->deleteMetadata());
$this->assertEqual($this->entity->less_important, '');
// clean up database
diff --git a/engine/tests/objects/users.php b/engine/tests/objects/users.php
index ba93c2439..d1533c3d2 100644
--- a/engine/tests/objects/users.php
+++ b/engine/tests/objects/users.php
@@ -220,29 +220,6 @@ class ElggCoreUserTest extends ElggCoreUnitTest {
$this->user->delete();
}
- // remove in 1.9
- public function testElggUserIsAdminLegacy() {
- $this->user->save();
- $this->user->makeAdmin();
-
- $this->assertTrue($this->user->admin);
- $this->assertTrue($this->user->siteadmin);
-
- $this->user->removeAdmin();
- $this->user->delete();
- }
-
- public function testElggUserIsNotAdminLegacy() {
- $this->user->save();
- $this->user->removeAdmin();
-
- $this->assertFalse($this->user->admin);
- $this->assertFalse($this->user->siteadmin);
-
- $this->user->removeAdmin();
- $this->user->delete();
- }
-
protected function fetchUser($guid) {
global $CONFIG;
diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php
index 23d6d1dc6..2bfc37558 100644
--- a/engine/tests/regression/trac_bugs.php
+++ b/engine/tests/regression/trac_bugs.php
@@ -146,9 +146,9 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest {
}
}
- register_plugin_hook('container_permissions_check', 'all', 'can_write_to_container_test_hook');
+ elgg_register_plugin_hook_handler('container_permissions_check', 'all', 'can_write_to_container_test_hook');
$this->assertTrue(can_write_to_container($user->guid, $object->guid));
- unregister_plugin_hook('container_permissions_check', 'all', 'can_write_to_container_test_hook');
+ elgg_unregister_plugin_hook_handler('container_permissions_check', 'all', 'can_write_to_container_test_hook');
$this->assertFalse(can_write_to_container($user->guid, $group->guid));
$group->join($user);