Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
WordPress international tags tests
<?php
class Tests_Term_Intl extends WP_UnitTestCase {
function test_one_char_terms() {
$post = array(
'post_content' => 'test',
'post_status' => 'publish',
'post_title' => 'test',
'post_type' => 'post',
'tags_input' => 'å,ä,ö',
);
$post_id = wp_insert_post( $post );
$term_names = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'names' ) );
$this->assertContains( 'å', $term_names );
$this->assertContains( 'ä', $term_names );
$this->assertContains( 'ö', $term_names );
}
function test_terms_with_non_intl_counterparts() {
$post = array(
'post_content' => 'test',
'post_status' => 'publish',
'post_title' => 'test',
'post_type' => 'post',
'tags_input' => 'for,för,får,far',
);
$post_id = wp_insert_post( $post );
$term_names = wp_get_post_terms( $post_id, 'post_tag', array( 'fields' => 'names' ) );
$this->assertContains( 'for', $term_names );
$this->assertContains( 'för', $term_names );
$this->assertContains( 'får', $term_names );
$this->assertContains( 'far', $term_names );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.