WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/18/2021 02:10:24 PM (2 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( ... > 0 ) with assertGreaterThan() to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449], [51451], [51453].

See #53363.

File:
1 edited

Legend:

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

    r51404 r51454  
    3030        $this->assertIsArray( $t );
    3131        $this->assertNotWPError( $t );
    32         $this->assertTrue( $t['term_id'] > 0 );
    33         $this->assertTrue( $t['term_taxonomy_id'] > 0 );
     32        $this->assertGreaterThan( 0, $t['term_id'] );
     33        $this->assertGreaterThan( 0, $t['term_taxonomy_id'] );
    3434        $this->assertEquals( $initial_count + 1, wp_count_terms( array( 'taxonomy' => $taxonomy ) ) );
    3535
    3636        // Make sure the term exists.
    37         $this->assertTrue( term_exists( $term ) > 0 );
    38         $this->assertTrue( term_exists( $t['term_id'] ) > 0 );
     37        $this->assertGreaterThan( 0, term_exists( $term ) );
     38        $this->assertGreaterThan( 0, term_exists( $t['term_id'] ) );
    3939
    4040        // Now delete it.
Note: See TracChangeset for help on using the changeset viewer.