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:
Scott Taylor
2013-09-12 05:08:33 +00:00
parent 6ced366e7c
commit f9877147f6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 );
}
/**