diff --git modules/system/system.test modules/system/system.test index 3045569..5607c88 100644 --- modules/system/system.test +++ modules/system/system.test @@ -1577,9 +1577,29 @@ class TokenReplaceTestCase extends DrupalWebTestCase { $result = token_replace($source, array('node' => $node), array('language' => $language, 'clear' => TRUE)); $result = $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens cleared out.'); - // Test without using the clear parameter (non-existant token untouched). + // Test without using the clear parameter (non-existent token untouched). $target .= '[user:name]'; $target .= '[bogus:token]'; + + // Begin mailing-list tests: see [#733192]. + $tests = array( + array('prefix' => 'this is the ', 'suffix' => ' site'), + array('prefix' => 'this is the', 'suffix' => 'site'), + array('prefix' => '[', 'suffix' => ']'), + array('prefix' => '', 'suffix' => ']]]'), + array('prefix' => '[[[', 'suffix' => ''), + array('prefix' => ':[:', 'suffix' => '--]'), + array('prefix' => '-[-', 'suffix' => ':]:'), + array('prefix' => '[:', 'suffix' => ']'), + array('prefix' => '[site:', 'suffix' => ':name]'), + array('prefix' => '[site:', 'suffix' => ']'), + ); + foreach ($tests as $test) { + $source .= $test['prefix'] . '[node:title]' . $test['suffix']; + $result .= $test['prefix'] . check_plain($node->title) . $test['suffix']; + } + // End mailing-list tests. + $result = token_replace($source, array('node' => $node), array('language' => $language)); $this->assertFalse(strcmp($target, $result), 'Valid tokens replaced while invalid tokens ignored.');