Move get_term_by()
tests to their own file.
git-svn-id: https://develop.svn.wordpress.org/trunk@34627 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8dc7bd8091
commit
148d6a37fe
@ -48,23 +48,6 @@ class Tests_Term extends WP_UnitTestCase {
|
||||
$this->assertTrue( wp_delete_term($t['term_id'], $this->taxonomy) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 15919
|
||||
*/
|
||||
|
23
tests/phpunit/tests/term/getTermBy.php
Normal file
23
tests/phpunit/tests/term/getTermBy.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user