Skip to content

Instantly share code, notes, and snippets.

@axiac
Forked from mathiasverraes/TestFrameworkInATweet.php
Created February 29, 2016 15:13
Show Gist options
  • Save axiac/8e66a0f0808c3a949b18 to your computer and use it in GitHub Desktop.
Save axiac/8e66a0f0808c3a949b18 to your computer and use it in GitHub Desktop.
A unit testing framework in a tweet.
<?php
require_once 'TestFrameworkInATweet.php';
it("should sum two numbers", 1+1==2);
it("should display an X for a failing test", 1+1==3);
done();
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment