Changeset 53559 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 06/23/2022 06:46:18 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r53238 r53559 1845 1845 $this->assertSameSets( array( 1, 2, 2 ), get_option( 'sticky_posts' ) ); 1846 1846 } 1847 1848 /** 1849 * Check if post supports block editor. 1850 * 1851 * @ticket 51819 1852 * @covers ::use_block_editor_for_post 1853 */ 1854 public function test_use_block_editor_for_post() { 1855 $this->assertFalse( use_block_editor_for_post( -1 ) ); 1856 $bogus_post_id = $this->factory()->post->create( 1857 array( 1858 'post_type' => 'bogus', 1859 ) 1860 ); 1861 $this->assertFalse( use_block_editor_for_post( $bogus_post_id ) ); 1862 1863 register_post_type( 1864 'restless', 1865 array( 1866 'show_in_rest' => false, 1867 ) 1868 ); 1869 $restless_post_id = $this->factory()->post->create( 1870 array( 1871 'post_type' => 'restless', 1872 ) 1873 ); 1874 $this->assertFalse( use_block_editor_for_post( $restless_post_id ) ); 1875 1876 $generic_post_id = $this->factory()->post->create(); 1877 1878 add_filter( 'use_block_editor_for_post', '__return_false' ); 1879 $this->assertFalse( use_block_editor_for_post( $generic_post_id ) ); 1880 remove_filter( 'use_block_editor_for_post', '__return_false' ); 1881 1882 add_filter( 'use_block_editor_for_post', '__return_true' ); 1883 $this->assertTrue( use_block_editor_for_post( $restless_post_id ) ); 1884 remove_filter( 'use_block_editor_for_post', '__return_true' ); 1885 } 1847 1886 }
Note: See TracChangeset
for help on using the changeset viewer.