Changeset 866 in tests
- Timestamp:
- 07/02/2012 06:25:12 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpunit.xml
r865 r866 8 8 <testsuite> 9 9 <directory suffix=".php">wp-testcase</directory> 10 <file phpVersion="5.3.0" phpVersionOperator=">=">wp-testcase/test_actions_closures.php</file> 10 11 <exclude>wp-testcase/test_query_results.php</exclude> 11 12 </testsuite> -
trunk/wp-testcase/test_actions.php
r862 r866 240 240 } 241 241 242 function test_action_closure() {243 if ( version_compare( PHP_VERSION, '5.3', '<' ) )244 $this->markTestSkipped( 'Closures are a PHP 5.3 feature.' );245 246 $this->knownWPBug(10493);247 248 $tag = rand_str();249 $closure = function($a, $b) { $GLOBALS[$a] = $b;};250 add_action($tag, $closure, 10, 2);251 252 $this->assertSame( 10, has_action($tag, $closure) );253 254 $context = array( rand_str(), rand_str() );255 do_action($tag, $context[0], $context[1]);256 257 $this->assertSame($GLOBALS[$context[0]], $context[1]);258 259 $tag2 = rand_str();260 $closure2 = function() { $GLOBALS['closure_no_args'] = true;};261 add_action($tag2, $closure2);262 263 $this->assertSame( 10, has_action($tag2, $closure2) );264 265 do_action($tag2);266 267 $this->assertTrue($GLOBALS['closure_no_args']);268 269 }270 271 242 }
Note: See TracChangeset
for help on using the changeset viewer.