Skip to content

Commit

Permalink
DX: Assert - use assertSame over assertEquals
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and sebastianbergmann committed Jun 23, 2018
1 parent 400a383 commit e9b5da0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Framework/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -1259,10 +1259,6 @@ public static function assertObjectNotHasAttribute(string $attributeName, $objec
*/
public static function assertSame($expected, $actual, string $message = ''): void
{
if (\is_bool($expected) && \is_bool($actual)) {
static::assertEquals($expected, $actual, $message);
}

static::assertThat(
$actual,
new IsIdentical($expected),
Expand Down Expand Up @@ -1791,14 +1787,14 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME

unset($tmp);

static::assertEquals(
static::assertSame(
$expectedElement->tagName,
$actualElement->tagName,
$message
);

if ($checkAttributes) {
static::assertEquals(
static::assertSame(
$expectedElement->attributes->length,
$actualElement->attributes->length,
\sprintf(
Expand Down Expand Up @@ -1832,7 +1828,7 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME
Xml::removeCharacterDataNodes($expectedElement);
Xml::removeCharacterDataNodes($actualElement);

static::assertEquals(
static::assertSame(
$expectedElement->childNodes->length,
$actualElement->childNodes->length,
\sprintf(
Expand Down

0 comments on commit e9b5da0

Please sign in to comment.