aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/api
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-09 17:08:11 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-09 17:08:11 +0000
commit0c4397913c7d313dbf10e9553f46e1d6715c6963 (patch)
tree3b0e7b9ada463f2637bff3a53344427ababf6b97 /engine/tests/api
parenta6ab24b467633c72aac740a8aa1ded9d8d0cc0cd (diff)
downloadelgg-0c4397913c7d313dbf10e9553f46e1d6715c6963.tar.gz
elgg-0c4397913c7d313dbf10e9553f46e1d6715c6963.tar.bz2
Fixes #2600. Applied Hellekin's patch. Props to him for understanding what was going on because whoa.
git-svn-id: http://code.elgg.org/elgg/trunk@8968 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests/api')
-rw-r--r--engine/tests/api/entity_getter_functions.php54
1 files changed, 29 insertions, 25 deletions
diff --git a/engine/tests/api/entity_getter_functions.php b/engine/tests/api/entity_getter_functions.php
index 1633cbe19..59aa7074a 100644
--- a/engine/tests/api/entity_getter_functions.php
+++ b/engine/tests/api/entity_getter_functions.php
@@ -1341,7 +1341,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
$e->save();
$guids[] = $e->getGUID();
@@ -1382,6 +1382,9 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
}
function testElggApiGettersEntityMetadataNVPValidNValidVEqualsTriple() {
+ if ($boasdf == true) {
+ $awoefhaow = true;
+ }
$subtypes = $this->getRandomValidSubtypes(array('object'), 1);
$subtype = $subtypes[0];
$md_name = 'test_metadata_name_' . rand();
@@ -1406,11 +1409,13 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
// make some bad ones
$invalid_md_name = 'test_metadata_name_' . rand();
+ $invalid_md_name2 = 'test_metadata_name_' . rand();
+ $invalid_md_name3 = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
- $e->$md_name2 = $invalid_md_value;
- $e->$md_name3 = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
+ $e->$invalid_md_name2 = $md_value2;
+ $e->$invalid_md_name3 = $md_value3;
$e->save();
$guids[] = $e->getGUID();
@@ -1483,10 +1488,11 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
// make some bad ones
$invalid_md_name = 'test_metadata_name_' . rand();
+ $invalid_md_name2 = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
- $e->$md_name2 = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
+ $e->$invalid_md_name2 = $md_value2;
$e->save();
$guids[] = $e->getGUID();
@@ -1572,11 +1578,11 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
- $e->$md_name2 = $invalid_md_value;
- $e->$md_name3 = $invalid_md_value;
- $e->$md_name4 = $invalid_md_value;
- $e->$md_name5 = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
+ $e->$md_name2 = $md_value2;
+ $e->$md_name3 = $md_value3;
+ $e->$md_name4 = $md_value4;
+ $e->$md_name5 = $md_value5;
$e->save();
$guids[] = $e->getGUID();
@@ -1649,7 +1655,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
$e->save();
$guids[] = $e->getGUID();
@@ -1694,7 +1700,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
$e->save();
$guids[] = $e->getGUID();
@@ -1758,7 +1764,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
$e->save();
$guids[] = $e->getGUID();
@@ -1836,7 +1842,7 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$invalid_md_name = 'test_metadata_name_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
- $e->$md_name = $invalid_md_value;
+ $e->$invalid_md_name = $md_value;
$e->save();
$guids[] = $e->getGUID();
@@ -1888,33 +1894,32 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$subtypes = $this->getRandomValidSubtypes(array('object'), 1);
$subtype = $subtypes[0];
$md_name = 'test_metadata_name_' . rand();
- $md_value = 2;
$guids = array();
$valid_guids = array();
// our targets
$valid = new ElggObject();
$valid->subtype = $subtype;
- $valid->$md_name = $md_value;
+ $valid->$md_name = 1;
$valid->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid->getGUID();
$valid2 = new ElggObject();
$valid2->subtype = $subtype;
- $valid2->$md_name = 3;
+ $valid2->$md_name = 2;
$valid2->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid2->getGUID();
$valid3 = new ElggObject();
$valid3->subtype = $subtype;
- $valid3->$md_name = 1;
+ $valid3->$md_name = 3;
$valid3->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid3->getGUID();
- $md_valid_values = array($md_value, $md_value2);
+ $md_valid_values = array(1, 2, 3);
$options = array(
'type' => 'object',
@@ -1947,33 +1952,32 @@ class ElggCoreEntityGetterFunctionsTest extends ElggCoreUnitTest {
$subtypes = $this->getRandomValidSubtypes(array('object'), 1);
$subtype = $subtypes[0];
$md_name = 'test_metadata_name_' . rand();
- $md_value = 'b';
$guids = array();
$valid_guids = array();
// our targets
$valid = new ElggObject();
$valid->subtype = $subtype;
- $valid->$md_name = $md_value;
+ $valid->$md_name = 'a';
$valid->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid->getGUID();
$valid2 = new ElggObject();
$valid2->subtype = $subtype;
- $valid2->$md_name = 'c';
+ $valid2->$md_name = 'b';
$valid2->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid2->getGUID();
$valid3 = new ElggObject();
$valid3->subtype = $subtype;
- $valid3->$md_name = 'a';
+ $valid3->$md_name = 'c';
$valid3->save();
$guids[] = $valid->getGUID();
$valid_guids[] = $valid3->getGUID();
- $md_valid_values = array($md_value, $md_value2);
+ $md_valid_values = array('a', 'b', 'c');
$options = array(
'type' => 'object',