PHPUnit 和存储过程
我正在我的系统中实现 PHPUnit。 但大部分逻辑部分是在存储过程/中处理的 我如何为它们编写存储过程?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我正在我的系统中实现 PHPUnit。 但大部分逻辑部分是在存储过程/中处理的 我如何为它们编写存储过程?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
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.