在 Phing 中调用 URL 并检索呈现的 HTML 页面

发布于 2024-09-06 09:51:15 字数 551 浏览 4 评论 0原文

所以这是我的困境 - 我正在使用 Eric Barnes 的优秀 codeigniter-simpletest 库(http://github .com/ericbarnes/codeigniter-simpletest)。它非常适合我的目的,因为它在我的 CodeIgniter 应用程序的测试部署中添加了一个端点,我可以通过该仪表板来运行所有单元测试并查看结果。到目前为止一切都很好。

但现在我开始将其集成到我的 Phing 构建脚本中(这样我的测试构建上的 phing 发布调用将触发单元测试,并在任何测试失败时使构建失败),但我陷入了困境。

由于集成包使 codeigniter 与 simpletest 配合得很好,所以 simpletest 的命令行运行程序不是一个选项(我不认为)。

有没有办法从 phing 调用 URL 并获取生成的 HTML?我可以将一些隐藏的 HTML 插入到构建的单元测试结果页面中,并从 Phing 任务中检查它。

So this is my dilemma - I am using the excellent codeigniter-simpletest library by Eric Barnes (http://github.com/ericbarnes/codeigniter-simpletest). Its perfect for my purposes, as it adds an endpoint onto the test deployment of my CodeIgniter application, from which I have a dashboard to run all my unit tests and view the results. Everything fine so far.

But now I come to integrating it into my Phing build script (so that a phing release call on my test build will trigger the unit tests and fail the build if any of the tests fail), and I'm stuck.

Due to the integration package to make codeigniter play nice with simpletest, the command line runner of simpletest is not an option (I don't think).

Is there a way to invoke a URL from phing, and grab the resulting HTML? I could insert some hidden HTML into the built unit tests results page and check for it from the Phing task.

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

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

发布评论

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

评论(1

朕就是辣么酷 2024-09-13 09:51:15

最近有一个新任务 HttpGetTask添加到 Phing 应该对您有帮助,它将在下一个版本(2.4.3)中发布。

A new task HttpGetTask was recently added to Phing that should help you, it will be released in the next release (2.4.3).

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