2013-08-07 08:38:38 +02:00
|
|
|
<?php
|
|
|
|
|
2019-01-28 15:10:24 +01:00
|
|
|
require_once dirname( __FILE__ ) . '/abstract-testcase.php';
|
2013-08-07 08:38:38 +02:00
|
|
|
|
2016-03-05 20:47:41 +01:00
|
|
|
/**
|
|
|
|
* Defines a basic fixture to run multiple tests.
|
|
|
|
*
|
|
|
|
* Resets the state of the WordPress installation before and after every test.
|
|
|
|
*
|
|
|
|
* Includes utility functions and assertions useful for testing WordPress.
|
|
|
|
*
|
|
|
|
* All WordPress unit tests should inherit from this class.
|
|
|
|
*/
|
2019-01-28 15:10:24 +01:00
|
|
|
class WP_UnitTestCase extends WP_UnitTestCase_Base {
|
2017-01-15 07:50:00 +01:00
|
|
|
|
2017-01-17 04:39:36 +01:00
|
|
|
/**
|
|
|
|
* Asserts that a condition is not false.
|
|
|
|
*
|
2017-12-08 22:00:08 +01:00
|
|
|
* This method has been backported from a more recent PHPUnit version, as tests running on PHP 5.2 use
|
|
|
|
* PHPUnit 3.6.x.
|
|
|
|
*
|
|
|
|
* @since 4.7.4
|
|
|
|
*
|
|
|
|
* @param bool $condition Condition to check.
|
|
|
|
* @param string $message Optional. Message to display when the assertion fails.
|
2017-01-17 04:39:36 +01:00
|
|
|
*
|
|
|
|
* @throws PHPUnit_Framework_AssertionFailedError
|
|
|
|
*/
|
|
|
|
public static function assertNotFalse( $condition, $message = '' ) {
|
|
|
|
self::assertThat( $condition, self::logicalNot( self::isFalse() ), $message );
|
|
|
|
}
|
2014-11-13 23:03:15 +01:00
|
|
|
}
|