Merge pull request #269 from chrisyue/master

add phpunit snippets
This commit is contained in:
Honza Pokorny 2013-08-26 13:21:15 -07:00
commit b410c9e3c4
2 changed files with 38 additions and 0 deletions

View File

@ -92,6 +92,14 @@ if (${1}) {
} }
endsnippet endsnippet
snippet ife "php ife" !b
if (${1}) {
${2}
} else {
}
endsnippet
snippet /** "php comment block" b snippet /** "php comment block" b
/** /**
* @${1} * @${1}

View File

@ -0,0 +1,30 @@
# sugguestion? report bugs?
# please go to https://github.com/chrisyue/vim-snippets/issues
snippet test "phpunit test class" b
namespace `!p
abspath = os.path.abspath(path)
m = re.search(r'[A-Z].+(?=/)', abspath)
if m:
snip.rv = m.group().replace('/', '\\')
`;
/**
* @author `whoami`
*/
class `!p
snip.rv = re.match(r'.*(?=\.)', fn).group()
` extends \PHPUnit_Framework_TestCase
{
public function test${1}()
{
${2}
}
}
endsnippet
snippet exp "phpunit expects" i
expects($this->${1:once}())
->method('${2}')
->with($this->equalTo(${3})${4})
->will($this->returnValue(${5}));
endsnippet