WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/15/2021 02:44:22 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( is_numeric( ... ) ) with assertIsNumeric() to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436].

See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post.php

    r51397 r51438  
    8080            // Insert a post and make sure the ID is OK.
    8181            $id = wp_insert_post( $post );
    82             $this->assertTrue( is_numeric( $id ) );
     82            $this->assertIsNumeric( $id );
    8383            $this->assertTrue( $id > 0 );
    8484
     
    136136        $this->post_ids[] = $id;
    137137        // dmp( _get_cron_array() );
    138         $this->assertTrue( is_numeric( $id ) );
     138        $this->assertIsNumeric( $id );
    139139        $this->assertTrue( $id > 0 );
    140140
     
    259259        $this->post_ids[] = $id;
    260260        // dmp( _get_cron_array() );
    261         $this->assertTrue( is_numeric( $id ) );
     261        $this->assertIsNumeric( $id );
    262262        $this->assertTrue( $id > 0 );
    263263
     
    380380        $this->post_ids[] = $id;
    381381        // dmp( _get_cron_array() );
    382         $this->assertTrue( is_numeric( $id ) );
     382        $this->assertIsNumeric( $id );
    383383        $this->assertTrue( $id > 0 );
    384384
Note: See TracChangeset for help on using the changeset viewer.