Skip to content

Commit b410c9e

Browse files
committed
Merge pull request honza#269 from chrisyue/master
add phpunit snippets
2 parents edc8cb0 + 702844e commit b410c9e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

UltiSnips/php.snippets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ if (${1}) {
9292
}
9393
endsnippet
9494

95+
snippet ife "php ife" !b
96+
if (${1}) {
97+
${2}
98+
} else {
99+
100+
}
101+
endsnippet
102+
95103
snippet /** "php comment block" b
96104
/**
97105
* @${1}

UltiSnips/php/phpunit.snippets

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# sugguestion? report bugs?
2+
# please go to https://github.com/chrisyue/vim-snippets/issues
3+
snippet test "phpunit test class" b
4+
namespace `!p
5+
abspath = os.path.abspath(path)
6+
m = re.search(r'[A-Z].+(?=/)', abspath)
7+
if m:
8+
snip.rv = m.group().replace('/', '\\')
9+
`;
10+
11+
/**
12+
* @author `whoami`
13+
*/
14+
class `!p
15+
snip.rv = re.match(r'.*(?=\.)', fn).group()
16+
` extends \PHPUnit_Framework_TestCase
17+
{
18+
public function test${1}()
19+
{
20+
${2}
21+
}
22+
}
23+
endsnippet
24+
25+
snippet exp "phpunit expects" i
26+
expects($this->${1:once}())
27+
->method('${2}')
28+
->with($this->equalTo(${3})${4})
29+
->will($this->returnValue(${5}));
30+
endsnippet

0 commit comments

Comments
 (0)