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/rest-api/rest-controller.php

    r51453 r51454  
    514514        $first_call_count = $listener->get_call_count( $method );
    515515
    516         $this->assertTrue( $first_call_count > 0 );
     516        $this->assertGreaterThan( 0, $first_call_count );
    517517
    518518        $request->set_param( '_fields', 'somestring' );
     
    526526        $controller->prepare_item_for_response( $item, $request );
    527527
    528         $this->assertTrue( $listener->get_call_count( $method ) > $first_call_count );
     528        $this->assertGreaterThan( $first_call_count, $listener->get_call_count( $method ) );
    529529    }
    530530
Note: See TracChangeset for help on using the changeset viewer.