Created
March 9, 2014 03:39
-
-
Save santiblanko/9442578 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
snippet testclass | |
class ${1}Test extends PHPUnit_Framework_TestCase | |
{ | |
protected setup() { | |
${2} | |
} | |
protected tearDown() { | |
${3} | |
} | |
} | |
snippet test | |
public function test${1}() | |
{ | |
${2} | |
} | |
# Assertions | |
snippet assIO | |
$this->assertInstanceOf(${1}, ${2}); | |
snippet assE | |
$this->assertEquals(${1}, ${2}); | |
snippet assN | |
$this->assertNull(${1}); | |
snippet assNN | |
$this->assertNotNull(${1}); | |
snippet assSE | |
$this->assertSelectEquals('${1:element path}', '${2:element contents}', ${3:count}, ${4:haystack}); | |
snippet assSC | |
$this->assertSelectCount('${1:element path}', ${2:count}, ${3:haystack}); | |
snippet assT | |
$this->assertTrue(${1:False}); | |
snippet assF | |
$this->assertFalse(${1:True}); | |
# Exception assertions | |
snippet exE | |
/** | |
* @expectedException ${1} | |
*/ | |
snippet exEM | |
/** | |
* @expectedException ${1} | |
* @expectedExceptionMessage ${2} | |
*/ | |
# Incomplete/Skipped tests. | |
snippet testIN | |
$this->markTestIncomplete( | |
'${1:Schtop! Thish tesht ish not ready yet!}' | |
); | |
snippet testSK | |
$this->markTestSkipped( | |
'${1:This test has been skipped.}' | |
); | |
# Mock Objects | |
snippet expects | |
$${1:mockObject}->expects(${2:<parameters>}) | |
->method('${3:methodName}') | |
->will($this->returnValue(${4:<returnValue>})); | |
snippet once | |
$this->once() | |
snippet any | |
$this->any() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment