Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 5, 2019
1 parent a6abdfa commit ca16574
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/unit/Framework/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3004,6 +3004,38 @@ public function testStringNotContainsStringCanBeAssertedIgnoringCase(): void
$this->fail();
}

public function testIterableContainsSameObjectCanBeAsserted(): void
{
$object = new \stdClass;
$iterable = [$object];

$this->assertContains($object, $iterable);

try {
$this->assertContains(new \stdClass, $iterable);
} catch (AssertionFailedError $e) {
return;
}

$this->fail();
}

public function testIterableNotContainsSameObjectCanBeAsserted(): void
{
$object = new \stdClass;
$iterable = [$object];

$this->assertNotContains(new \stdClass, $iterable);

try {
$this->assertNotContains($object, $iterable);
} catch (AssertionFailedError $e) {
return;
}

$this->fail();
}

protected function sameValues(): array
{
$object = new \SampleClass(4, 8, 15);
Expand Down

0 comments on commit ca16574

Please sign in to comment.