05b7e5c4e2
with existing PHP snippets' namespace and adding `<?php` Changed PHPUnit and Symfony snippet's namespace and author to be consistent with other PHP snippets class blah
41 lines
709 B
Plaintext
41 lines
709 B
Plaintext
# suggestion? report bugs?
|
|
# please go to https://github.com/chrisyue/vim-snippets/issues
|
|
priority -50
|
|
|
|
snippet test "phpunit test class" b
|
|
<?php
|
|
|
|
namespace `!p
|
|
relpath = os.path.relpath(path)
|
|
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
if m:
|
|
snip.rv = m.group().replace('/', '\\')
|
|
`;
|
|
|
|
/**
|
|
* @author `!v g:snips_author`
|
|
*/
|
|
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
|
|
|
|
snippet testcmt "phpunit comment with group" b
|
|
/**
|
|
* @group ${1}
|
|
*/
|
|
endsnippet
|