Skip to content

Commit e7af732

Browse files
committed
Initial snippets for phpspec
1 parent 5812cba commit e7af732

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

UltiSnips/php-phpspec.snippets

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Snippets for phpspec
2+
3+
priority -50
4+
5+
snippet spec "phpspec class" b
6+
<?php
7+
8+
namespace `!p
9+
relpath = os.path.relpath(path)
10+
m = re.search(r'[A-Z].+(?=/)', relpath)
11+
if m:
12+
snip.rv = m.group().replace('/', '\\')
13+
`;
14+
15+
use PhpSpec\ObjectBehavior;
16+
use Prophecy\Argument;
17+
18+
/**
19+
* @author `!v g:snips_author`
20+
*/
21+
class `!p
22+
snip.rv = re.match(r'.*(?=\.)', fn).group()
23+
` extends ObjectBehavior
24+
{
25+
public function it${1:_does_something}()
26+
{
27+
$0
28+
}
29+
}
30+
endsnippet
31+
32+
snippet it "phpspec function it..." b
33+
public function it${1:_does_something}()
34+
{
35+
$0
36+
}
37+
endsnippet
38+

0 commit comments

Comments
 (0)