Changeset 32182 for branches/3.9/tests/phpunit/tests/post.php
- Timestamp:
- 04/20/2015 11:08:17 AM (11 years ago)
- File:
-
- 1 edited
-
branches/3.9/tests/phpunit/tests/post.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/tests/phpunit/tests/post.php
r27720 r32182 914 914 915 915 } 916 917 /** 918 * @ticket 21212 919 */ 920 function test_utf8mb3_post_saves_with_emoji() { 921 global $wpdb; 922 $_wpdb = new wpdb_exposed_methods_for_testing(); 923 924 if ( 'utf8' !== $_wpdb->get_col_charset( $wpdb->posts, 'post_title' ) ) { 925 $this->markTestSkipped( 'This test is only useful with the utf8 character set' ); 926 } 927 928 require_once( ABSPATH . '/wp-admin/includes/post.php' ); 929 930 $post_id = $this->factory->post->create(); 931 932 $data = array( 933 'post_ID' => $post_id, 934 'post_title' => "foo\xf0\x9f\x98\x88bar", 935 'post_content' => "foo\xf0\x9f\x98\x8ebaz", 936 'post_excerpt' => "foo\xf0\x9f\x98\x90bat" 937 ); 938 939 $expected = array( 940 'post_title' => "foobar", 941 'post_content' => "foobaz", 942 'post_excerpt' => "foobat" 943 ); 944 945 edit_post( $data ); 946 947 $post = get_post( $post_id ); 948 949 foreach( $expected as $field => $value ) { 950 $this->assertEquals( $post->$field, $value ); 951 } 952 }
Note: See TracChangeset
for help on using the changeset viewer.