diff options
Diffstat (limited to 'modules/simpletest/tests/registry.test')
-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 |