mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-07 09:49:04 +00:00
Use reset() to access the first element of an array, don't assume there is an item at index 0.
See #25282. git-svn-id: https://develop.svn.wordpress.org/trunk@25384 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -85,7 +85,7 @@ class Tests_Term_getTerms extends WP_UnitTestCase {
|
||||
function test_get_terms_should_allow_arbitrary_indexed_taxonomies_array() {
|
||||
$term_id = $this->factory->tag->create();
|
||||
$terms = get_terms( array( '111' => 'post_tag' ), array( 'hide_empty' => false ) );
|
||||
$this->assertEquals( $term_id, $terms[0]->term_id );
|
||||
$this->assertEquals( $term_id, reset( $terms )->term_id );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user