Changeset 35163
- Timestamp:
- 10/14/2015 09:29:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/getArchives.php
r34686 r35163 9 9 */ 10 10 class Tests_Get_Archives extends WP_UnitTestCase { 11 protected $post_ids;11 protected static $post_ids; 12 12 protected $month_url; 13 13 … … 17 17 $this->month_url = get_month_link( date( 'Y' ), date( 'm' ) ); 18 18 $this->year_url = get_year_link( date( 'Y' ) ); 19 $this->post_ids = $this->factory->post->create_many( 8, array( 'post_type' => 'post', 'post_author' => '1' ) ); 19 } 20 21 public static function setUpBeforeClass() { 22 $factory = new WP_UnitTest_Factory(); 23 self::$post_ids = $factory->post->create_many( 8, array( 'post_type' => 'post', 'post_author' => '1' ) ); 24 25 self::commit_transaction(); 26 } 27 28 public static function tearDownAfterClass() { 29 foreach ( self::$post_ids as $post_id ) { 30 wp_delete_post( $post_id, true ); 31 } 32 33 self::commit_transaction(); 20 34 } 21 35 … … 31 45 32 46 function test_wp_get_archives_limit() { 33 $ids = array_slice( array_reverse( $this->post_ids ), 0, 5 );47 $ids = array_slice( array_reverse( self::$post_ids ), 0, 5 ); 34 48 35 49 $link1 = get_permalink( $ids[0] );
Note: See TracChangeset
for help on using the changeset viewer.