thomasruiz / given-php Goto Github PK
View Code? Open in Web Editor NEWA PHP Framework for Unit Testing
A PHP Framework for Unit Testing
I think it would be super nice if in the given when and then blocks, you could define a label first.
eg. Currently I have a test:
describe('Math', function () {
context('Addition', function () {
given('x', 2);
given('y', 4);
when('sum', function ($x, $y) {
return $x + $y;
});
then(function ($sum) {
return $sum === 6;
});
then(function ($sum) {
return $sum !== 5;
});
});
});
It would be nice to express this as:
describe('Math', function () {
context('Addition', function () {
given('a variable x', 'x', 2);
given('a variable y', 'y', 4);
when('I add x and y', 'sum', function ($x, $y) {
return $x + $y;
});
then('I should get 6', function ($sum) {
return $sum === 6;
});
then('I should not get 5', function ($sum) {
return $sum !== 5;
});
});
});
This reads better in the test itself and would allow you to write a formatter that reads better.
This library looks very much like what I'm after.
How stable is it? You say it's 'pre alpha' in your docs. When do you think it might be ready for use?
If you think this is something I might be able to make use of in the near future and if you need help testing and improving documentation, I'd be happy to help out.
thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.