mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests. Props johnillo Fixes #37371 git-svn-id: https://develop.svn.wordpress.org/trunk@52389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -51,14 +51,17 @@ class Tests_Term extends WP_UnitTestCase {
|
||||
*/
|
||||
public function test_is_term_type() {
|
||||
// Insert a term.
|
||||
$term = rand_str();
|
||||
$term = 'term_new';
|
||||
$t = wp_insert_term( $term, $this->taxonomy );
|
||||
$this->assertIsArray( $t );
|
||||
$term_obj = get_term_by( 'name', $term, $this->taxonomy );
|
||||
$this->assertEquals( $t['term_id'], term_exists( $term_obj->slug ) );
|
||||
|
||||
$exists = term_exists( $term_obj->slug );
|
||||
// Clean up.
|
||||
$this->assertTrue( wp_delete_term( $t['term_id'], $this->taxonomy ) );
|
||||
$deleted = wp_delete_term( $t['term_id'], $this->taxonomy );
|
||||
|
||||
$this->assertEquals( $t['term_id'], $exists );
|
||||
$this->assertTrue( $deleted );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user