testify
A Sublime Text plugin aimed at making writing PHPUnit tests less painful.
Details
Installs
- Total 232
- Win 106
- Mac 78
- Linux 48
Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
testify
A Sublime Text plugin aimed at making writing PHPUnit tests less painful.
Installation
- Download the file
- Unarchive the file in Sublime Text packages folder
The new menus and command palette options should appear in yout Sublime Text installation
Usage
Natural language test names
The plugin will take test method names written in natural language
should throw for something
should not call that when called with this
constructor properly sets some value
constructor will not do something
some method should fail with foo, baz and bar
and will transform those in proper PHPUnit test methods like
public function SomethingProvider()
{
// $something
return array(
array(null)
);
}
/**
* @dataProvider SomethingProvider
*/
public function testShouldThrowForThis($something)
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
/**
* @dataProvider ThisProvider
*/
public function testShouldNotCallThatWhenCalledWithThis($this)
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
public function testConstructorProperlySetsSomeValue()
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
public function testConstructorWillNotDoSomething()
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
public function FooBazBarProvider()
{
// $foo, $baz, $bar
return array(
array(null, null, null)
);
}
/**
* @dataProvider FooBazBarProvider
*/
public function testSomeMethodShouldFailWithFooBazAndBar($foo, $baz, $bar)
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
using camelCase notation.
Data Providers
The plugin will presume that lines containing the words with
or for
are for tests that will require a dataProvider
method and will generate the data provider and the associated variables by default as seen in the first, second and fifth line above.
The plugin will also avoid generating duplicate data provider methods.
Appending a trailing -
to the line will prevent the plugin from generating a data provider method
add default throws for null value argument-
will generate
public function testAddDefaultThrowsForNullValueArgument()
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
while
add default throws for null value argument
would generate the test method and the data provider method as well
public function NullValueArgumentProvider()
{
// $nullValueArgument
return array(
array(null)
);
}
/**
* @dataProvider NullValueArgumentProvider
*/
public function testAddDefaultThrowsForNullValueArgument($nullValueArgument)
{
$this->markTestIncomplete('This test has not been implemented yet.');
}
which might not always be the desired result.