diff options
author | Cash Costello <cash.costello@gmail.com> | 2012-07-05 17:12:19 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2012-07-05 17:12:19 -0700 |
commit | 35bd23ec8deb6c1f576780169bd0808caae4bdd1 (patch) | |
tree | d0c1f73dabf08333cd10e6a2d9384a39b40c36ba /engine/tests/api | |
parent | 34576a1f81d50a44064567469eb1406a028c92a7 (diff) | |
parent | 8a5ddacfa2598b8d984c2cdc6142d41936f38c48 (diff) | |
download | elgg-35bd23ec8deb6c1f576780169bd0808caae4bdd1.tar.gz elgg-35bd23ec8deb6c1f576780169bd0808caae4bdd1.tar.bz2 |
Merge pull request #281 from mrclay/2276-friendly-title
Fixes #2276: Better friendly titles
Diffstat (limited to 'engine/tests/api')
-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(); } |