PhpSpec Snippets
Autocompletion to speed up writing PhpSpec examples in Sublime Text
Details
Installs
- Total 14K
- Win 10K
- Mac 2K
- Linux 2K
Apr 2 | Apr 1 | Mar 31 | Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | 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 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 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 | 1 | 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 | 2 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Sublime PhpSpec Snippets
Make writing PhpSpec examples and matchers in your Specs a little easier in Sublime Text 2 & 3.
Installation
This plugin is available as a sublime package search for “PhpSpec Snippets”.
Alternatively clone this repository into your Packages/
folder.
Usage
Currently this plugin provides a command to help writing examples with PhpSpec and severals snippets to use.
Complete example command
I hate typing underscores, and I wrote this command to ease that pain. It can be accessed in two ways:
- Open the command panel and type “PhpSpec: complete example”
- Right click and select “PhpSpec: complete example”
The plugin will take the text from the current line and transform it into a PhpSpec example. You can also create examples over multiple lines.
The snippet generator doesn't care if you include or leave out the
function
declaration and/or it_
/its_
, the generated example
will prepend those automatically.
Shortcuts
SUS Constructor
bct
BeConstructedThrough.
beConstructedThrough('',array());
bcw
BeConstructedWith.
beConstructedWith();
Let & Let go
let
Setup method for phpspec.
function let()
{
}
letgo
Teardown method for phpspec.
function letgo()
{
}
Matchers
sb
shouldBe.
shouldBe();
snb
shouldNotBe.
shouldNotBe();
sbi
shouldBeAnInstanceOf.
shouldBeAnInstanceOf();
snbi
shouldNotBeAnInstanceOf.
shouldNotBeAnInstanceOf();
sbl
shouldBeLike.
shouldBeLike();
snbl
shouldNotBeLike.
shouldNotBeLike();
se
shouldEqual.
shouldBeEqual();
sne
shouldNotEqual.
shouldNotEqual();
sht
shouldHaveType.
shouldHaveType();
snht
shouldNotHaveType.
shouldNotHaveType();
si
shouldImplement.
shouldImplement();
sni
shouldNotImplement.
shouldNotImplement();
sr
shouldReturn.
shouldReturn();
snr
shouldNotReturn.
shouldNotReturn();
st
shouldThrow.
shouldThrow('')->during();
Stubs, Mocks and spies
wr
willReturn.
willReturn();
wt
willThrow.
willThrow();
sbc
shouldBeCalled.
shouldBeCalled();
bnbc
shouldNotBeCalled.
shouldNotBeCalled();
bhbc
shouldHaveBeenCalled.
shouldHaveBeenCalled();
snhbc
shouldNotHaveBeenCalled.
shouldNotHaveBeenCalled();
TODO
- Fix code for positioning cursor (it's a bit tempremental)