Make WordPress Core


Ignore:
Timestamp:
07/12/2021 10:35:44 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Use more appropriate assertions in various tests.

This replaces instances of assertTrue( in_array( ... ) ) with assertContains() to use native PHPUnit functionality.

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

Props hellofromTonya, jrf, SergeyBiryukov.
Fixes #53123. See #53363.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/DeleteComment.php

    r49603 r51404  
    109109        // Check for either possible total.
    110110        $message = sprintf( 'returned value: %1$d $total: %2$d  $recalc_total: %3$d', (int) $xml->response[0]->comment[0]->supplemental[0]->total[0], $total, $recalc_total );
    111         $this->assertTrue( in_array( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0], array( $total, $recalc_total ), true ), $message );
     111        $this->assertContains( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0], array( $total, $recalc_total ), $message );
    112112    }
    113113
Note: See TracChangeset for help on using the changeset viewer.