Ticket #33968: awesome.diff
File awesome.diff, 1.1 KB (added by , 10 years ago) |
---|
-
tests/phpunit/includes/testcase.php
14 14 protected static $hooks_saved = array(); 15 15 protected static $ignore_files; 16 16 17 function __isset( $name ) { 18 return 'factory' === $name; 19 } 20 17 21 /** 18 22 * @var WP_UnitTest_Factory 19 23 */ 20 protected static $factory; 24 function __get( $name ) { 25 if ( 'factory' === $name ) { 26 return self::factory(); 27 } 28 } 21 29 30 protected static function factory() { 31 static $factory = null; 32 33 if ( ! $factory ) { 34 $factory = new WP_UnitTest_Factory(); 35 } 36 37 return $factory; 38 } 39 22 40 public static function get_called_class() { 23 41 if ( function_exists( 'get_called_class' ) ) { 24 42 return get_called_class(); … … 81 99 $wpdb->db_connect(); 82 100 ini_set('display_errors', 1 ); 83 101 $this->clean_up_global_scope(); 84 85 102 /* 86 103 * When running core tests, ensure that post types and taxonomies 87 104 * are reset for each test. We skip this step for non-core tests,