Browse files

Added some basic snippets for working with PHPUnit

  • Loading branch information...
1 parent e40c836 commit 398e0483b13249f8ac29abce247eb1fdf97b22b2 @stuartherbert committed Feb 2, 2012
Showing with 71 additions and 0 deletions.
  1. +34 −0 phpunit-test.sublime-snippet
  2. +37 −0 phpunit-testcase.sublime-snippet
View
34 phpunit-test.sublime-snippet
@@ -0,0 +1,34 @@
+<!--
+ phpunit-test
+ A time-saving snippet for adding new tests to your unit test class
+
+ HOW TO USE
+ In your PHP class, simply type the following:
+
+ phpunit-test<TAB><testcase-name>
+
+ Sublime Text will add the new test method to your file, and
+ give the method the name that you choose.
+
+-->
+<snippet>
+ <content><![CDATA[
+public function test${1:[testcase-name]}()
+{
+ // setup your test
+
+ // pre-conditions
+
+ // perform the change
+
+ // test the results
+}
+
+]]></content>
+ <!-- Optional: Tab trigger to activate the snippet -->
+ <tabTrigger>phpunit-test</tabTrigger>
+ <!-- Optional: Scope the tab trigger will be active in -->
+ <scope>source.php</scope>
+ <!-- Optional: Description to show in the menu -->
+ <description>Create a skeleton test method</description>
+</snippet>
View
37 phpunit-testcase.sublime-snippet
@@ -0,0 +1,37 @@
+<!--
+ phpunit-testsuite
+ A time-saving device for creating skeleton PHPUnit TestCase classes
+
+ HOW TO USE
+ In your PHP class, simply type the following:
+
+ phpunit-testcase<TAB><classname>
+
+ Sublime Text will add the new TestCase class to your file, and
+ give the class the name that you choose.
+
+-->
+<snippet>
+ <content><![CDATA[
+
+class ${1:[ClassName]}Test extends PHPUnit_Framework_TestCase
+{
+ public function setUp()
+ {
+ // your code here
+ }
+
+ public function tearDown()
+ {
+ // your code here
+ }
+}
+
+]]></content>
+ <!-- Optional: Tab trigger to activate the snippet -->
+ <tabTrigger>phpunit-testcase</tabTrigger>
+ <!-- Optional: Scope the tab trigger will be active in -->
+ <scope>source.php</scope>
+ <!-- Optional: Description to show in the menu -->
+ <description>Create a skeleton TestCase class</description>
+</snippet>

0 comments on commit 398e048

Please sign in to comment.