PHPUnit比较方法

时间:2019-03-19 15:34:17

标签: unit-testing phpunit

在使用PHPUnit时,我需要检查一些函数调用。我在PHPUnit文档中找到了以下示例:https://phpunit.readthedocs.io/en/8.0/test-doubles.html#test-doubles-mock-objects-examples-subjecttest2-php

要测试参数类型,请使用greaterThan而不是assertGreaterThan。而且在文档中,我找不到任何提及非assert方法的问题。

我需要测试严格的相等性(通常使用assertSame完成),在github上搜索后,我在https://github.com/sebastianbergmann/phpunit/blob/master/src/Framework/Assert/Functions.php中发现了identicalTo方法,该方法将与{ {1}}。

任何地方都有官方文档,详细说明这些方法以及它们与assertSame one的链接

0 个答案:

没有答案