Changeset 10768 for sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php
- Timestamp:
- 03/05/2021 12:05:23 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php
r10765 r10768 101 101 } 102 102 103 public function test_get_post_types_custom() { 104 reinit_handbooks( [ 'plugins-handbook', 'themes' ], 'post_types' ); 105 106 // Note: The automatic appending of '-handbook' is for back-compat. 107 $this->assertEquals( ['plugins-handbook', 'themes-handbook'], WPorg_Handbook_Init::get_post_types() ); 108 } 109 103 110 public function test_get_post_types_filtered() { 111 add_filter( 'handbook_post_types', function ( $post_types ) { 112 $post_types[] = 'example'; 113 return $post_types; 114 }, 11 ); 104 115 reinit_handbooks( [ 'plugins', 'themes' ], 'post_types' ); 105 116 106 117 // Note: The automatic appending of '-handbook' is for back-compat. 107 $this->assertEquals( [ 'plugins-handbook', 'themes-handbook'], WPorg_Handbook_Init::get_post_types() );118 $this->assertEquals( [ 'plugins-handbook', 'themes-handbook', 'example-handbook' ], WPorg_Handbook_Init::get_post_types() ); 108 119 } 109 120
Note: See TracChangeset
for help on using the changeset viewer.