Skip to content

Instantly share code, notes, and snippets.

@alenabdula
Last active December 20, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alenabdula/4e6591bb25f0e9dae4e2 to your computer and use it in GitHub Desktop.
Save alenabdula/4e6591bb25f0e9dae4e2 to your computer and use it in GitHub Desktop.
Sublime Text snippet to automate process of creating a PHPUnit test case
<snippet>
<content>
<![CDATA[
/** @test */
function ${1/\s/_/g}()
{
${0:// ${1:type method name with spaces when done press tab}}
}
]]>
</content>
<tabTrigger>test@</tabTrigger>
<scope>source.php</scope>
</snippet>
@alenabdula
Copy link
Author

How do i use this?

  1. Create new .php file
  2. Type test@ and hit TAB
  3. Start naming your method by typing normally (with spaces)
  4. All the spaces will be converted to _ (underscores)
  5. Hit TAB to select comment text, fire away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment