TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Parody – a PHP testing library

45 pointsby mattsahover 12 years ago

6 comments

freeworkover 12 years ago
I'm confused, what does this have to do with Aaron Swartz?
评论 #5049394 未加载
sentientalover 12 years ago
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 未加载
0x0over 12 years ago
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 未加载
wvenableover 12 years ago
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 未加载
Gigablahover 12 years ago
This library could use Composer support. I suppose I'll make a quick pull request.
评论 #5049413 未加载
parf73over 12 years ago
great simplistic php testing framework: <a href="https://github.com/parf/spartan-test" rel="nofollow">https://github.com/parf/spartan-test</a>