在 phpunit 中连接约束
我的问题是,如何将子句中的约束与 phpunit 连接起来? 在虚拟示例中:
$test->expects ($this->once())
->method ('increaseValue')
->with ($this->greaterThan (0)
->will ($this->returnValue (null));
方法 increaseValue 的参数必须大于 0,但如果我需要评估该参数必须小于 10。
如何连接 $this->lessThan (10)
?
My question is, how I concatenate constrains in the clausule with of phpunit?
In the dummy example:
$test->expects ($this->once())
->method ('increaseValue')
->with ($this->greaterThan (0)
->will ($this->returnValue (null));
The parameter of the method increaseValue must be greater than 0, but If I need evaluate that this parameter must be less than 10.
How I concatenate $this->lessThan(10)
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
ticalAnd
表达式:有关可能的函数列表,请检查以下函数:
PHPUnit/Framework/Assert.php
不以“assert”开头完整示例
结果
You can use the
logicalAnd
expression:For a list of possible functions check the functions in:
PHPUnit/Framework/Assert.php
that don't start with "assert"Complete Example
Result