# Testify - automate test writing

Being in the process of rewriting many test methods and classes for my set of libraries I’ve undergone the stress of writing test method signatures the whole day.
Sure some text snippets exist to make the process way slicker but I like to use tests to describe the interface of the test subject and write them all together.

## End result

The end result would be to be able to write, in a .php source test file, something like

class GlobalsTest extends \Codeception\TestCase\Test
{
constructor throws for non string parameters
constructor inits arg1 proper
method dies on missing file
}

where, aside for a basic test class skeleton, I can write test names and what I’m testing in a lengthy form I’m familiar typing: using camelCaseNotation to write test names or using_underscores_to_separate_words is way more encumbering that writing words the same way I’m writing this post: using spaces and lowercase letters.
I’d like to be able to parse the lines above and get, just pushing a button, something like

class GlobalsTest extends \Codeception\TestCase\Test
{
public function testConstructorThrowsForNonStringParameters()
{
$this->markTestIncomplete( 'This test has not been implemented yet.' ); } public function testConstructorInitsArg1Proper() {$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}

public function testMethodDiesOnMissingFile()
{

\$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}

## Sublime Text and plugins to the rescue

After quickly finding out this could not be done with a text snippet, I know how to create those, I’ve gone for a plugin, at its core will take the natural language lines and prepend and append needed text.
The plugin is in a dramatic alpha stage and since I’ve learnt Python 2 hours ago will probably fail any code beauty contest. A first version can be found on GitHub and, once downloaded, can be simply copied in the Packages folder of Sublime Text.