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.php

    r51438 r51454  
    156156        $this->assertIsNumeric( $t );
    157157        $this->assertNotWPError( $t );
    158         $this->assertTrue( $t > 0 );
     158        $this->assertGreaterThan( 0, $t );
    159159        $this->assertEquals( $initial_count + 1, wp_count_terms( array( 'taxonomy' => 'category' ) ) );
    160160
    161161        // Make sure the term exists.
    162         $this->assertTrue( term_exists( $term ) > 0 );
    163         $this->assertTrue( term_exists( $t ) > 0 );
     162        $this->assertGreaterThan( 0, term_exists( $term ) );
     163        $this->assertGreaterThan( 0, term_exists( $t ) );
    164164
    165165        // Now delete it.
Note: See TracChangeset for help on using the changeset viewer.