testify
A Sublime Text plugin aimed at making writing PHPUnit tests less painful.
Details
Installs
- Total 236
- Win 109
- Mac 79
- Linux 48
Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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.