diff options
author | Steve Clay <steve@mrclay.org> | 2012-06-25 01:25:46 -0400 |
---|---|---|
committer | Steve Clay <steve@mrclay.org> | 2012-06-26 10:25:50 -0400 |
commit | 4fff20a33467a7318956412d4dabfcab1ce6daba (patch) | |
tree | b9b2a9d43c01e094cff258f9b4720a663123f0eb /engine/tests/api/metadata.php | |
parent | d71309056037adc869319566f9ec53313eb192d8 (diff) | |
download | elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.gz elgg-4fff20a33467a7318956412d4dabfcab1ce6daba.tar.bz2 |
Fixes #2276: Better friendly titles, portable ElggTranslit class, better units
Diffstat (limited to 'engine/tests/api/metadata.php')
-rw-r--r-- | engine/tests/api/metadata.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/engine/tests/api/metadata.php b/engine/tests/api/metadata.php index 244036f80..c63b0cbec 100644 --- a/engine/tests/api/metadata.php +++ b/engine/tests/api/metadata.php @@ -28,6 +28,8 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { public function testGetMetastringById() { foreach (array('metaUnitTest', 'metaunittest', 'METAUNITTEST') as $string) { + // in case previous tests failed to cleanup after themselves + $this->delete_metastrings($string); $this->create_metastring($string); } @@ -194,11 +196,19 @@ class ElggCoreMetadataAPITest extends ElggCoreUnitTest { $u2->delete(); } + protected function delete_metastrings($string) { + global $CONFIG, $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; + $METASTRINGS_CACHE = $METASTRINGS_DEADNAME_CACHE = array(); + + $string = sanitise_string($string); + mysql_query("DELETE FROM {$CONFIG->dbprefix}metastrings WHERE string = BINARY '$string'"); + } protected function create_metastring($string) { global $CONFIG, $METASTRINGS_CACHE, $METASTRINGS_DEADNAME_CACHE; $METASTRINGS_CACHE = $METASTRINGS_DEADNAME_CACHE = array(); + $string = sanitise_string($string); mysql_query("INSERT INTO {$CONFIG->dbprefix}metastrings (string) VALUES ('$string')"); $this->metastrings[$string] = mysql_insert_id(); } |