mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
git-svn-id: https://develop.svn.wordpress.org/trunk@34627 602fd350-edb4-49c9-b593-d223f7449a82
24 lines
552 B
PHP
24 lines
552 B
PHP
<?php
|
|
|
|
/**
|
|
* @group taxonomy
|
|
*/
|
|
class Tests_Term_GetTermBy extends WP_UnitTestCase {
|
|
/**
|
|
* @ticket 21651
|
|
*/
|
|
function test_get_term_by_tt_id() {
|
|
$term1 = wp_insert_term( 'Foo', 'category' );
|
|
$term2 = get_term_by( 'term_taxonomy_id', $term1['term_taxonomy_id'], 'category' );
|
|
$this->assertEquals( get_term( $term1['term_id'], 'category' ), $term2 );
|
|
}
|
|
|
|
/**
|
|
* @ticket 33281
|
|
*/
|
|
function test_get_term_by_with_nonexistent_id_should_return_false() {
|
|
$term = get_term_by( 'id', 123456, 'category' );
|
|
$this->assertFalse( $term );
|
|
}
|
|
}
|