File: php_phpunit.snippets

package info (click to toggle)
vim-snippets 1.0.0-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 900 kB
  • sloc: python: 9; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# suggestion? report bugs?
# please go to https://github.com/chrisyue/vim-snippets/issues
priority -50

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