WordPress.org

Make WordPress Core

Changeset 34879


Ignore:
Timestamp:
10/06/2015 07:55:56 PM (3 years ago)
Author:
jorbin
Message:

Add message with status info to temperamental assertion.

The ajax delete comment tests are intermittently failing. Many of the assertions make it hard to tell why they are failing. This adds a message to one of those assertions that contains some info on what is being asserted with the goal that it helps developers understand why the failure is failing.

See #33968

File:
1 edited

Legend:

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

    r25002 r34879  
    102102
    103103        // Check for either possible total
    104         $this->assertTrue( in_array( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0] , array( $total, $recalc_total ) ) );
     104        $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 );
     105        $this->assertTrue( in_array( (int) $xml->response[0]->comment[0]->supplemental[0]->total[0] , array( $total, $recalc_total ) ), $message );
    105106    }
    106107
Note: See TracChangeset for help on using the changeset viewer.