Changeset 48952 for trunk/tests/phpunit/includes/testcase.php
- Timestamp:
- 09/07/2020 03:12:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r47198 r48952 17 17 * Asserts that a condition is not false. 18 18 * 19 * This method has been backported from a more recent PHPUnit version, as tests running on PHP 5.2 use20 * PHPUnit 3.6.x.19 * This method has been backported from a more recent PHPUnit version, 20 * as tests running on PHP 5.2 use PHPUnit 3.6.x. 21 21 * 22 22 * @since 4.7.4 … … 30 30 self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message ); 31 31 } 32 33 /** 34 * Asserts that two variables are equal (with delta). 35 * 36 * This method has been backported from a more recent PHPUnit version, 37 * as tests running on PHP 5.6 use PHPUnit 5.7.x. 38 * 39 * @since 5.6.0 40 * 41 * @param mixed $expected First value to compare. 42 * @param mixed $actual Second value to compare. 43 * @param float $delta Allowed numerical distance between two values to consider them equal. 44 * @param string $message Optional. Message to display when the assertion fails. 45 * 46 * @throws ExpectationFailedException 47 * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException 48 */ 49 public static function assertEqualsWithDelta( $expected, $actual, $delta, $message = '' ) { 50 $constraint = new PHPUnit_Framework_Constraint_IsEqual( 51 $expected, 52 $delta 53 ); 54 55 static::assertThat( $actual, $constraint, $message ); 56 } 32 57 }
Note: See TracChangeset
for help on using the changeset viewer.