Changeset 103 in tests
- Timestamp:
- 12/04/2007 01:25:08 AM (17 years ago)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testcase/test_meta.php
r81 r103 4 4 class WPTestMeta extends WPTestCase { 5 5 var $val; 6 6 7 7 function setUp() { 8 8 parent::setUp(); … … 18 18 $this->assertTrue($this->val); 19 19 } 20 21 // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference 22 function test_globals() { 23 global $test_foo; 24 $test_foo = array('foo', 'bar', 'baz'); 25 26 function test_globals_foo() { 27 unset($GLOBALS['test_foo'][1]); 28 } 29 30 test_globals_foo(); 31 32 $this->assertEquals($test_foo, array(0=>'foo', 2=>'baz')); 33 $this->assertEquals($test_foo, $GLOBALS['test_foo']); 34 } 35 36 function test_globals_bar() { 37 global $test_bar; 38 $test_bar = array('a', 'b', 'c'); 39 $this->assertEquals($test_bar, $GLOBALS['test_bar']); 40 } 41 20 42 } 21 43 -
wp-testlib/base.php
r101 r103 14 14 15 15 class WPTestCase extends PHPUnit_Framework_TestCase { 16 17 protected $backupGlobals = FALSE; 16 18 17 19 function setUp() {
Note: See TracChangeset
for help on using the changeset viewer.