Skip to content

Commit ea496c9

Browse files
committed
ITT: New reflection assertions added.
1 parent d939e47 commit ea496c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Asserts/ReflectionAsserts.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,16 @@ protected function assertTraitNotUsed($class, $trait)
2727
$message = "Failed asserting that class `{$class}` is not using trait `{$trait}`.";
2828
$this->assertNotContains($trait, class_uses($class), $message);
2929
}
30+
31+
protected function assertMethodExists($object, $method)
32+
{
33+
$message = "Failed asserting that `{$method}` method exists on specified object.";
34+
$this->assertTrue(method_exists($object, $method), $message);
35+
}
36+
37+
protected function assertMethodNotExists($object, $method)
38+
{
39+
$message = "Failed asserting that `{$method}` method not exists on specified object.";
40+
$this->assertFalse(method_exists($object, $method), $message);
41+
}
3042
}

0 commit comments

Comments
 (0)