PHPUnit 和存储过程

发布于 2024-10-06 10:40:43 字数 61 浏览 0 评论 0 原文

我正在我的系统中实现 PHPUnit。 但大部分逻辑部分是在存储过程/中处理的 我如何为它们编写存储过程?

I am implementing PHPUnit in my system.
But most of the logic part is handled in stored proecdure/
How do i write stored procedure for them?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

垂暮老矣 2024-10-13 10:40:44

PHPUnit 专注于 PHP 测试。调用数据库中的存储过程不会改变这一点,您仍然可以测试您的 PHP 代码。 PHPUnit-test 无法测试存储过程内的所有逻辑,但它可以测试黑盒。

如果您使用 PostgreSQL 作为数据库,您可以查看 pgTAP 在数据库内进行单元测试。

PHPUnit has it's focus on PHP-testing. Calling a stored procedure in a database doesn't change that, you can still test your PHP-code. You PHPUnit-test can't test all the logic inside the stored procedure, but it can test the black box.

If you use PostgreSQL as your database, you could take a look at pgTAP for unit testing inside your database.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文