使用“方法”的Phpunit测试存储库

发布于 2025-01-29 18:34:52 字数 209 浏览 2 评论 0原文

我已经尝试解决了一段时间。 我正在测试一个使用“使用”方法的存储库,但是我不知道如何编写测试以涵盖该方法。

        $this->entity
        ->shouldReceive('with')
        ->once()
        ->andReturnSelf();

似乎不起作用

I've been trying to solve this for a while.
I'm testing a repository that uses the 'with' method however I can't figure out how to write the tests to cover the method.

        $this->entity
        ->shouldReceive('with')
        ->once()
        ->andReturnSelf();

doesn't seem to work

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文