public
Description: PHP acceptance test tool based on Concordion
Homepage:
Clone URL: git://github.com/andyhd/Comity.git
andyhd (author)
Tue Jul 28 16:04:57 -0700 2009
commit  4402e95f82889d186b30ea4ee454bb5ec847d8bf
tree    9788b37465ccbc4d9396c828634667af2a76986b
parent  2251b9310a5e2c12f9b2ffc94d51ee096af849ef
Comity /
name age message
file Exception.php Loading commit data...
file README.textile
file Test.php
README.textile

Comity

This is just a proof of concept implementation, based on my very limited test of Concordion, which looks awesome.

By contrast, Comity is a gruesome hack which runs tests inline with report generation, rather than generating static reports offline.

The code was cobbled together quickly on the bus this morning, and debugged a little at lunch.

It’s called Comity because that’s the nicest word I found when typing Concord into thesaurus.com :-)

Comity is currently meant to work in conjunction with Minim by adding some new template functions. These allow you to do the following:


  <p>
    The name
    <? $exec('$result = splitName(#TEXT)') ?>John Smith<? $endExec() ?>
    should be split into the first name
    <? $assertEquals('$result->firstName') ?>John<? $endAssert() ?>
    and the last name
    <? $assertEquals('$result->lastName') ?>Smith<? $endAssert() ?>.
  </p>

The controller behind this template must extend Comity_Test:


class Test extends Comity_Test
{
    function index()
    {
        $this->render('test');
    }

    function splitName($name)
    {
        $result = explode(' ', $name, 2);
        return (object) array(
            'firstName' => @$result[0],
            'lastName' => @$result[1]
        );
    }
}

The template, when executed, will display something like this:

The name John Smith should be split into the first name John and the last name Smith.