Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Merge [999].

  • Loading branch information...
commit db09aeefb85b3f9d66741651aa6755d02ad5201c 1 parent 25dde82
@sebastianbergmann authored
Showing with 14 additions and 6 deletions.
  1. +14 −6 PHPUnit/Framework/Assert.php
View
20 PHPUnit/Framework/Assert.php
@@ -822,9 +822,13 @@ public static function assertObjectNotHasAttribute($attributeName, $object, $mes
*/
public static function assertSame($expected, $actual, $message = '')
{
- $constraint = new PHPUnit_Framework_Constraint_IsIdentical($expected);
+ if (is_bool($expected) && is_bool($actual)) {
+ self::assertEquals($expected, $actual);
+ } else {
+ $constraint = new PHPUnit_Framework_Constraint_IsIdentical($expected);
- self::assertThat($actual, $constraint, $message);
+ self::assertThat($actual, $constraint, $message);
+ }
}
/**
@@ -860,11 +864,15 @@ public static function assertAttributeSame($expected, $actualAttributeName, $act
*/
public static function assertNotSame($expected, $actual, $message = '')
{
- $constraint = new PHPUnit_Framework_Constraint_Not(
- new PHPUnit_Framework_Constraint_IsIdentical($expected)
- );
+ if (is_bool($expected) && is_bool($actual)) {
+ self::assertNotEquals($expected, $actual);
+ } else {
+ $constraint = new PHPUnit_Framework_Constraint_Not(
+ new PHPUnit_Framework_Constraint_IsIdentical($expected)
+ );
- self::assertThat($actual, $constraint, $message);
+ self::assertThat($actual, $constraint, $message);
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.