TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Parody – a PHP testing library

45 点作者 mattsah超过 12 年前

6 条评论

freework超过 12 年前
I'm confused, what does this have to do with Aaron Swartz?
评论 #5049394 未加载
sentiental超过 12 年前
There are a number of mock object libraries out there (mockery, shmock, phpunit's mock syntax, etc). This just looks like another builder syntax for making mocks / stubs with some fanciness around class extension - what's the benefit?<p>Also, how often is it useful to define a class at test time that is initialized by production code (from the section I Still Have Serious Dependency Issues!). This seems like an unlikely use case.
评论 #5049262 未加载
0x0超过 12 年前
Noticing it's licensed under AGPL. I guess that means all projects that happen to include this (or something depending on it) would then be required to post full source code on the webpage, even if the project is for a single install?
评论 #5049463 未加载
wvenable超过 12 年前
Since this library requires PHP 5.4, I'm not sure why it bothers with this syntax:<p><pre><code> Parody\Mime::create('Vendor\Class\Project') -&#62; onCall('method') -&#62; expect('argument one') -&#62; give('response one') -&#62; onCall('method') -&#62; expect('argument two') -&#62; give('response two') -&#62; resolve(); </code></pre> When one could just use anonymous functions to give the same result with less API-as-code.<p><pre><code> Parody\Mime::create('Vendor\Class\Project') -&#62; onCall('method', function($param) { if ($param == 'argument one') return 'response one'; if ($param == 'argument two') return 'response two'; ) -&#62; resolve(); </code></pre> This is more flexible, less code for the framework, and easier to learn.
评论 #5050255 未加载
Gigablah超过 12 年前
This library could use Composer support. I suppose I'll make a quick pull request.
评论 #5049413 未加载
parf73超过 12 年前
great simplistic php testing framework: <a href="https://github.com/parf/spartan-test" rel="nofollow">https://github.com/parf/spartan-test</a>