Skip to content

andyhd/Comity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

PHP acceptance test tool based on Concordion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages