Skip to content

Commit

Permalink
- Merge [999].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 7, 2007
1 parent 25dde82 commit db09aee
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions PHPUnit/Framework/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit db09aee

Please sign in to comment.