Make WordPress Core


Ignore:
Timestamp:
09/12/2013 05:08:33 AM (11 years ago)
Author:
wonderboymusic
Message:

Use reset() to access the first element of an array, don't assume there is an item at index 0.

See #25282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/getTerms.php

    r25257 r25384  
    8686        $term_id = $this->factory->tag->create();
    8787        $terms = get_terms( array( '111' => 'post_tag' ), array( 'hide_empty' => false ) );
    88         $this->assertEquals( $term_id, $terms[0]->term_id );
     88        $this->assertEquals( $term_id, reset( $terms )->term_id );
    8989    }
    9090
Note: See TracChangeset for help on using the changeset viewer.