Arkanis Development

Styles

Shinpuru

Published

It's released... finally! Shinpuru (Japanese for "simple") is a small PHP testing tool to write easy and maintainable test suites. Download one file, require() it and write your test code, that's it:

<?php

require('shinpuru.php');

test('My website should have 10 articles on the front page', function(){
    get('http://arkanis.de/');
    assert_select('article', 10);
});

?>

The test file can then be run from the command line and reports the test results:

$ php basic_usage_test.php
Running: basic_usage_test.php
.
1 test successful
No tests failed, good job!

Additionally Shinpuru can run in autotest mode, that is it will automatically run the test suite as soon as a file in the current directory changes (you can also monitor other directories and files as well). The result of each run is then reported in the console and if you run Ubuntu Linux also with a nice confirmation bubble. That way you only have to look at your console when a test failed.

The confirmation bubble of an successful test suite

Here's a short run down on what Shinpuru has to offer:

If you want to give Shinpuru a try, just take a look at the Shinpuru project page. It contains a nice tutorial and will help you getting started. More experience users can also take a look at the reference to see the details.

Development and Feedback

All this isn't new of course. Shinpuru is heavily inspired by testing frameworks of the Ruby world, mainly Shoulda. It all started as a small idea to use the anonymous functions of PHP 5.3 and I got hooked up in the process somehow. Shinpuru itself took about 3 weeks of my spare time but the work on the documentation and refining the details continued for about 7 more weeks. Now I'm just happy the project is in a state where it can be useful for other programmers.

If there is some interest in Shinpuru it's no problem to setup a public repository and a forum or something like that. For now please feel free to post comments on this blog post or send me mails (see profile page). I'm very interested in what people think about Shinpuru. :)

3 comments for this post

leave a new one

#1 by
mario

Finally a testing framework without syntactic cruft! I've been looking a while for something without PHPUnit-style overhead. And this looks very promising. I can see how it would work well on many real world test cases. Thanks and keep it up!

#2 by
Stephan

Thanks mario, good to know someone thinks it's useful. :)

#3 by
Chris

Wow, looks amazing! Got to try it out…

Leave a new comment

Having thoughts on your mind about this stuff here? Want to tell me and the rest of the world your opinion? Write and post it right here. Be sure to check out the format help (focus the large text field) and give the preview button a try.

optional

Format help

Please us the following stuff to spice up your comment.

An empty line starts a new paragraph. ---- print "---- lines start/end code" ---- * List items start with a * or -

Just to keep your skill sharp and my comments clean.

or