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/ajax/DeleteComment.php

    r51404 r51438  
    206206        } catch ( WPAjaxDieStopException $e ) {
    207207            $this->assertSame( 10, strlen( $e->getMessage() ) );
    208             $this->assertTrue( is_numeric( $e->getMessage() ) );
     208            $this->assertIsNumeric( $e->getMessage() );
    209209        } catch ( Exception $e ) {
    210210            $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
     
    256256        } catch ( WPAjaxDieStopException $e ) {
    257257            $this->assertSame( 10, strlen( $e->getMessage() ) );
    258             $this->assertTrue( is_numeric( $e->getMessage() ) );
     258            $this->assertIsNumeric( $e->getMessage() );
    259259        } catch ( Exception $e ) {
    260260            $this->fail( 'Unexpected exception type: ' . get_class( $e ) );
Note: See TracChangeset for help on using the changeset viewer.