2014-03-11 16:10:50 -04:00
|
|
|
# suggestion? report bugs?
|
2013-11-16 14:45:48 -05:00
|
|
|
# please go to https://github.com/chrisyue/vim-snippets/issues
|
2014-03-11 16:10:50 -04:00
|
|
|
priority -50
|
|
|
|
|
2013-11-16 14:45:48 -05:00
|
|
|
snippet test "phpunit test class" b
|
2016-05-14 07:57:54 -04:00
|
|
|
<?php
|
|
|
|
|
2014-03-11 16:10:50 -04:00
|
|
|
namespace `!p
|
2016-05-14 07:57:54 -04:00
|
|
|
relpath = os.path.relpath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
2013-11-16 14:45:48 -05:00
|
|
|
if m:
|
|
|
|
snip.rv = m.group().replace('/', '\\')
|
|
|
|
`;
|
|
|
|
|
|
|
|
/**
|
2016-05-14 07:57:54 -04:00
|
|
|
* @author `!v g:snips_author`
|
2013-11-16 14:45:48 -05:00
|
|
|
*/
|
|
|
|
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
|
2015-01-18 07:58:28 -05:00
|
|
|
|
|
|
|
snippet testcmt "phpunit comment with group" b
|
|
|
|
/**
|
|
|
|
* @group ${1}
|
|
|
|
*/
|
|
|
|
endsnippet
|