Changeset 35186 for trunk/tests/phpunit/tests/functions/getArchives.php
- Timestamp:
- 10/15/2015 04:43:37 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/getArchives.php
r35163 r35186 19 19 } 20 20 21 public static function setUpBeforeClass() { 22 $factory = new WP_UnitTest_Factory(); 21 public static function wpSetUpBeforeClass( $factory ) { 23 22 self::$post_ids = $factory->post->create_many( 8, array( 'post_type' => 'post', 'post_author' => '1' ) ); 24 25 self::commit_transaction();26 23 } 27 24 28 public static function tearDownAfterClass() {25 public static function wpTearDownAfterClass() { 29 26 foreach ( self::$post_ids as $post_id ) { 30 27 wp_delete_post( $post_id, true ); 31 28 } 32 33 self::commit_transaction();34 29 } 35 30 … … 53 48 $link5 = get_permalink( $ids[4] ); 54 49 50 $title1 = get_post( $ids[0] )->post_title; 51 $title2 = get_post( $ids[1] )->post_title; 52 $title3 = get_post( $ids[2] )->post_title; 53 $title4 = get_post( $ids[3] )->post_title; 54 $title5 = get_post( $ids[4] )->post_title; 55 55 56 $expected['limit'] = <<<EOF 56 <li><a href='$link1'> Post title 8</a></li>57 <li><a href='$link2'> Post title 7</a></li>58 <li><a href='$link3'> Post title 6</a></li>59 <li><a href='$link4'> Post title 5</a></li>60 <li><a href='$link5'> Post title 4</a></li>57 <li><a href='$link1'>$title1</a></li> 58 <li><a href='$link2'>$title2</a></li> 59 <li><a href='$link3'>$title3</a></li> 60 <li><a href='$link4'>$title4</a></li> 61 <li><a href='$link5'>$title5</a></li> 61 62 EOF; 62 63 $this->assertEquals( $expected['limit'], trim( wp_get_archives( array( 'echo' => false, 'type' => 'postbypost', 'limit' => 5 ) ) ) );
Note: See TracChangeset
for help on using the changeset viewer.