vs code phpunit snippets
1.0.0
ตัวอย่าง PHPUnit สำหรับ VSCode
รายการตัวอย่าง
assertArrayHasKey()
assertAttributeEquals()
assertClassHasAttribute()
assertClassHasStaticAttribute()
assertContains()
assertContainsOnly()
assertCount()
assertEquals()
assertEmpty()
assertEqualXMLStructure()
assertFalse()
assertFileEquals()
assertFileExists()
assertGreatherThan()
assertGreaterThanOrEqual()
assertInstanceOf()
assertInternalType()
assertLessThan()
assertLessThanOrEqual()
assertNotNull()
assertNull()
assertObjectHasAttribute()
assertRegExp()
assertSame()
assertSelectCount()
assertSelectEquals()
assertStringEqualsFile()
assertStringEndsWith()
assertStringMatchesFormat()
assertStringMatchesFormatFile()
assertSelectRegExp()
assertStringStartsWith()
assertTrue()
assertTag()
assertXmlFileEqualsXmlFile()
assertXmlStringEqualsXmlFile()
assertXmlStringEqualsXmlString()
การตั้งค่า
public function setUp()
{
// set up
}
รื้อถอน
public function tearDown()
{
// tear down
}
ทดสอบ
/**
* @covers [Class]::[Method]()
*/
public function test[Method]()
{
// assertions
}
ทดสอบ2
/**
* @covers [Class]::[Method1]()
* @covers [Class]::[Method2]()
*/
public function test[Method1]_[Method2]()
{
// assertions
}
อัณฑะ
/**
* @covers [Class]::[Method]()
* @expectedException [Exception]
*/
public function test[Method]()
{
// assertions
}
ลูกอัณฑะ
/**
* @covers [Class]::[Method]()
*/
public function test[Method]()
{
$this->markTestIncomplete('Not yet implemented');
}
สนุก!