Changeset 30276 for trunk/tests/phpunit/tests/query/date.php
- Timestamp:
- 11/08/2014 03:29:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/date.php
r25139 r30276 11 11 public $q; 12 12 13 public function setUp() {14 parent::setUp(); 15 13 static $post_ids = array(); 14 15 public static function setUpBeforeClass() { 16 16 // Be careful modifying this. Tests are coded to expect this exact sample data. 17 17 $post_dates = array( … … 41 41 ); 42 42 43 $factory = new WP_UnitTest_Factory; 44 43 45 foreach ( $post_dates as $post_date ) { 44 $this->factory->post->create( array( 'post_date' => $post_date ) );46 self::$post_ids[] = $factory->post->create( array( 'post_date' => $post_date ) ); 45 47 } 46 48 49 self::commit_transaction(); 50 } 51 52 public static function tearDownAfterClass() { 53 foreach ( self::$post_ids as $post_id ) { 54 wp_delete_post( $post_id, true ); 55 } 56 57 self::commit_transaction(); 58 } 59 60 public function setUp() { 61 parent::setUp(); 47 62 unset( $this->q ); 48 63 $this->q = new WP_Query();
Note: See TracChangeset
for help on using the changeset viewer.