1.相等断言 $this-assertEquals(0,count($stack)); 错误相关信息的输出 2.依赖关系depends标注来表达测试方法之间的依赖关系。/*** dependstestPush*/.不为空断言$this-assertNotEmpty($stack); 4.对异常进行测试$this-expectException(InvalidArgumentException::class); 除了expectException()方法外,还有expectExceptionCode()、expectExceptionMessage()和expectExceptionMessageRegExp()方法可以用于为被测代码所抛出的异常建立预期。 5.异常检测标注/** * expectedExceptionInvalidArgumentException*/ 6.预期错误/** * expectedExceptionPHPUnit_Framework_Error*/7.对会引发PHP错误的代码的返回值进行测试$this-assertFalse()8.对输出的结果进行预测 $this-expectOutputString() 如果输出的结果不匹配则为FALSE 9.命令行测试执行器10.将测试标记为未完成$this-markTestIn最好白癜风治疗方法北京哪看女性白癜风好
|