aboutsummaryrefslogtreecommitdiff
path: root/engine/tests
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 03:40:59 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-14 03:40:59 +0000
commitc9d4cf5b0b0f5ad3056cd4d6dc744a8b4890fb4e (patch)
tree832898dc37e4678a4d77a9338cd46c4feb6bba64 /engine/tests
parent8e065905e4172d0ccd01266c6f8e58a65803d011 (diff)
downloadelgg-c9d4cf5b0b0f5ad3056cd4d6dc744a8b4890fb4e.tar.gz
elgg-c9d4cf5b0b0f5ad3056cd4d6dc744a8b4890fb4e.tar.bz2
Updated trunk to use new annotation functions. Added checks for annotations_* options vs annotation_* options because it's so easy to confuse.
git-svn-id: http://code.elgg.org/elgg/trunk@8223 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests')
-rw-r--r--engine/tests/api/entity_getter_functions.php4
-rw-r--r--engine/tests/api/metastrings.php4
-rw-r--r--engine/tests/regression/trac_bugs.php34
3 files changed, 21 insertions, 21 deletions
diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php
index e3e265d21..1633cbe19 100644
--- a/engine/tests/api/entity_getter_functions.php
+++ b/engine/tests/api/entity_getter_functions.php
@@ -239,7 +239,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$name = 'test_annotation_name_' . rand();
$value = rand();
$id = create_annotation($entity->getGUID(), $name, $value, 'integer', $entity->getGUID());
- $annotations[] = get_annotation($id);
+ $annotations[] = elgg_get_annotation_from_id($id);
}
return $annotations;
@@ -2772,7 +2772,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
} while(in_array($e->guid, $a_e_map));
// remove annotations left over from previous tests.
- clear_annotations($e->guid);
+ elgg_delete_annotations(array('annotation_owner_guid' => $e->guid));
$annotations = $this->createRandomAnnotations($e);
foreach($annotations as $a) {
diff --git a/engine/tests/api/metastrings.php b/engine/tests/api/metastrings.php
index 9d089f804..e5cfe80e1 100644
--- a/engine/tests/api/metastrings.php
+++ b/engine/tests/api/metastrings.php
@@ -88,14 +88,14 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest {
}
}
- public function testGetMetastringObjectByID() {
+ public function testGetMetastringObjectFromID() {
$db_prefix = elgg_get_config('dbprefix');
$annotations = $this->createAnnotations(1);
$metadata = $this->createMetadata(1);
foreach ($this->metastringTypes as $type) {
$id = ${$type}[0];
- $test = elgg_get_metastring_based_object_by_id($id, $type);
+ $test = elgg_get_metastring_based_object_from_id($id, $type);
$this->assertEqual($id, $test->id);
}
diff --git a/engine/tests/regression/trac_bugs.php b/engine/tests/regression/trac_bugs.php
index 93831fd7e..71aae3d34 100644
--- a/engine/tests/regression/trac_bugs.php
+++ b/engine/tests/regression/trac_bugs.php
@@ -14,7 +14,7 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest {
public function __construct() {
$this->ia = elgg_set_ignore_access(TRUE);
parent::__construct();
-
+
// all __construct() code should come after here
}
@@ -48,20 +48,20 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest {
public function testElggObjectClearAnnotations() {
$this->entity = new ElggObject();
$guid = $this->entity->save();
-
+
$this->entity->annotate('test', 'hello', ACCESS_PUBLIC);
-
- $this->entity->clearAnnotations('does not exist');
-
+
+ $this->entity->deleteAnnotations('does not exist');
+
$num = $this->entity->countAnnotations('test');
-
+
//$this->assertIdentical($num, 1);
$this->assertEqual($num, 1);
-
+
// clean up
$this->entity->delete();
}
-
+
/**
* #2063 - get_resized_image_from_existing_file() fails asked for image larger than selection and not scaling an image up
* Test get_image_resize_parameters().
@@ -69,44 +69,44 @@ class ElggCoreRegressionBugsTest extends ElggCoreUnitTest {
public function testElggResizeImage() {
$orig_width = 100;
$orig_height = 150;
-
+
// test against selection > max
$options = array(
'maxwidth' => 50,
'maxheight' => 50,
'square' => TRUE,
'upscale' => FALSE,
-
+
'x1' => 25,
'y1' => 75,
'x2' => 100,
'y2' => 150
);
-
- // should get back the same x/y offset == x1, y1 and an image of 50x50
+
+ // should get back the same x/y offset == x1, y1 and an image of 50x50
$params = get_image_resize_parameters($orig_width, $orig_height, $options);
-
+
$this->assertEqual($params['newwidth'], $options['maxwidth']);
$this->assertEqual($params['newheight'], $options['maxheight']);
$this->assertEqual($params['xoffset'], $options['x1']);
$this->assertEqual($params['yoffset'], $options['y1']);
-
+
// test against selection < max
$options = array(
'maxwidth' => 50,
'maxheight' => 50,
'square' => TRUE,
'upscale' => FALSE,
-
+
'x1' => 75,
'y1' => 125,
'x2' => 100,
'y2' => 150
);
-
+
// should get back the same x/y offset == x1, y1 and an image of 25x25
$params = get_image_resize_parameters($orig_width, $orig_height, $options);
-
+
$this->assertEqual($params['newwidth'], 25);
$this->assertEqual($params['newheight'], 25);
$this->assertEqual($params['xoffset'], $options['x1']);