Changeset 10761 for sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php
- Timestamp:
- 03/04/2021 11:27:47 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php
r10760 r10761 44 44 public function test_get_handbook_objects_default() { 45 45 $handbooks = WPorg_Handbook_Init::get_handbook_objects(); 46 $first_handbook = reset( $handbooks ); 46 47 47 48 $this->assertIsArray( $handbooks ); 48 49 $this->assertCount( 1, $handbooks ); 49 $this->assertInstanceOf( 'WPorg_Handbook', $ handbooks[0]);50 $this->assertEquals( 'handbook', $ handbooks[0]->post_type );50 $this->assertInstanceOf( 'WPorg_Handbook', $first_handbook ); 51 $this->assertEquals( 'handbook', $first_handbook->post_type ); 51 52 } 52 53 … … 58 59 $this->assertIsArray( $handbooks ); 59 60 $this->assertCount( 2, $handbooks ); 60 $this->assertInstanceOf( 'WPorg_Handbook', $handbooks[0] ); 61 $this->assertEquals( 'plugins-handbook', $handbooks[0]->post_type ); 62 $this->assertInstanceOf( 'WPorg_Handbook', $handbooks[1] ); 63 $this->assertEquals( 'themes-handbook', $handbooks[1]->post_type ); 61 62 $first_handbook = reset( $handbooks ); 63 $this->assertInstanceOf( 'WPorg_Handbook', $first_handbook ); 64 $this->assertEquals( 'plugins-handbook', $first_handbook->post_type ); 65 66 $second_handbook = next( $handbooks ); 67 $this->assertInstanceOf( 'WPorg_Handbook', $second_handbook ); 68 $this->assertEquals( 'themes-handbook', $second_handbook->post_type ); 64 69 } 65 70 … … 75 80 reinit_handbooks( [ 'plugins', 'themes' ], 'post_types' ); 76 81 77 $this->assertEquals( ['plugins', 'themes'], WPorg_Handbook_Init::get_post_types() ); 82 // Note: The automatic appending of '-handbook' is for back-compat. 83 $this->assertEquals( ['plugins-handbook', 'themes-handbook'], WPorg_Handbook_Init::get_post_types() ); 78 84 } 79 85
Note: See TracChangeset
for help on using the changeset viewer.