diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-05-10 16:46:24 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-05-10 16:46:24 +0000 |
commit | 43ad4ad1407ab46876e7785da6f0952b07071b99 (patch) | |
tree | de01ea340e059c1a97a2d14ca31757ea9699cac1 /modules/simpletest | |
parent | b9b0063a486b16e2a8780b344876f41dd565df5a (diff) | |
download | brdo-43ad4ad1407ab46876e7785da6f0952b07071b99.tar.gz brdo-43ad4ad1407ab46876e7785da6f0952b07071b99.tar.bz2 |
- Patch #458566 by chx: work around PHP's curly bracket madness.
Diffstat (limited to 'modules/simpletest')
-rw-r--r-- | modules/simpletest/tests/registry.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index 4a859a64f..97ac23da8 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -135,3 +135,23 @@ CONTENTS; } +class RegistrySkipBodyTestCase extends DrupalWebTestCase { + public static function getInfo() { + return array( + 'name' => t('Skip function body test'), + 'description' => t('Tokenize a simple function and check that the body is skipped right'), + 'group' => t('System'), + ); + } + + function testRegistrySkipBody () { + // This string contains all three kinds of opening braces. + $function = '<?php function foo () { $x = "{$y}"; $x = "${y}" }'; + $tokens = token_get_all($function); + _registry_skip_body($tokens); + // Consume the last } + each($tokens); + $this->assertIdentical(each($tokens), FALSE, t('Tokens skipped')); + } + +}
\ No newline at end of file |