Skip to content

Instantly share code, notes, and snippets.

@mwidmann
Last active April 9, 2018 13:05
Show Gist options
  • Save mwidmann/18262f0ee86d6e58194643151a41ae71 to your computer and use it in GitHub Desktop.
Save mwidmann/18262f0ee86d6e58194643151a41ae71 to your computer and use it in GitHub Desktop.
Custom php snippets for Visual Studio Code
{
"PHPUnit Testcase": {
"prefix": "testcase",
"body": [
"",
"use Illuminate\\Foundation\\Testing\\WithoutMiddleware;",
"use Illuminate\\Foundation\\Testing\\DatabaseMigrations;",
"use Illuminate\\Foundation\\Testing\\DatabaseTransactions;",
"",
"class ${TM_FILENAME_BASE} extends TestCase",
"{",
"\t$0",
"}"
],
"description": "TestCase"
},
"PHPUnit Test Function": {
"prefix": "testfunc",
"body": [
"/** @test */",
"function ${1:the_one_where}()",
"{",
"\t$0",
"}"
],
"description": "create a test function"
},
"TEE PHPUnit Testcase": {
"prefix": "tee-testcase",
"body": [
"",
"namespace Tests\\\\${TM_DIRECTORY/(.*)\\/(.+)$/$2/};",
"",
"use Tests\\TestCase;",
"use Illuminate\\Foundation\\Testing\\DatabaseMigrations;",
"use Illuminate\\Foundation\\Testing\\DatabaseTransactions;",
"",
"class ${TM_FILENAME_BASE} extends TestCase",
"{",
"\t$0",
"}"
],
"description": "create a Testcase for PHPUnit Tests in TEE Projects"
},
"Class Template": {
"prefix": "cc",
"body": [
"",
"namespace ${1:Russmedia\\\\Newspaper\\\\}${TM_DIRECTORY/^(.*)([\\\\|\\/]src[\\\\|\\/])(.*)$/$3/}",
"",
"class ${TM_FILENAME_BASE}",
"{",
"\t$0",
"}"
],
"description": "create a new Class, add Namespace automatically"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment