Dav*_*ess 18
使用assertInstanceOf()而不是PHP的内置instanceof运算符或函数,以便您获得有意义的失败消息.
function testInstanceOf() {
$obj = new Foo;
self::assertInstanceOf('Bar', $obj);
}
...
Failed asserting that <Foo> is an instance of class "Bar".
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3855 次 |
| 最近记录: |