Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Merge [876].

  • Loading branch information...
commit 8daf4aaf6dc284836522e0a5c33b0bc6248f330a 1 parent 97519be
@sebastianbergmann authored
Showing with 20 additions and 16 deletions.
  1. +20 −16 PHPUnit/Framework/Assert.php
View
36 PHPUnit/Framework/Assert.php
@@ -604,20 +604,22 @@ public static function assertFileNotExists($filename, $message = '')
*
* @param boolean $condition
* @param string $message
- * @throws PHPUnit_Framework_ComparisonFailure
- * @throws InvalidArgumentException
+ * @throws PHPUnit_Framework_AssertionFailedError
* @access public
* @static
*/
public static function assertTrue($condition, $message = '')
{
- if (!is_bool($condition)) {
- throw new InvalidArgumentException;
- }
+ if ($condition !== TRUE) {
+ throw new PHPUnit_Framework_AssertionFailedError(
+ sprintf(
+ '%sFailed asserting that %s is true.',
- $constraint = new PHPUnit_Framework_Constraint_IsIdentical(TRUE);
-
- self::assertThat($condition, $constraint, $message);
+ $message != '' ? $message . "\n" : '',
+ PHPUnit_Util_Type::toString($condition)
+ )
+ );
+ }
}
/**
@@ -625,20 +627,22 @@ public static function assertTrue($condition, $message = '')
*
* @param boolean $condition
* @param string $message
- * @throws PHPUnit_Framework_ComparisonFailure
- * @throws InvalidArgumentException
+ * @throws PHPUnit_Framework_AssertionFailedError
* @access public
* @static
*/
public static function assertFalse($condition, $message = '')
{
- if (!is_bool($condition)) {
- throw new InvalidArgumentException;
- }
+ if ($condition !== FALSE) {
+ throw new PHPUnit_Framework_AssertionFailedError(
+ sprintf(
+ '%sFailed asserting that %s is false.',
- $constraint = new PHPUnit_Framework_Constraint_IsIdentical(FALSE);
-
- self::assertThat($condition, $constraint, $message);
+ $message != '' ? $message . "\n" : '',
+ PHPUnit_Util_Type::toString($condition)
+ )
+ );
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.