Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added phpunit boiler plate snippet. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ __ For PHP files:__
* __php-mit__: insert the MIT license as a PHP docblock
* __php-newbsd__: insert the new BSD license as a PHP docblock
* __php-section-comment__: insert a prominent comment to help break up the sections of your class
* __php-unit-test__: Generates PHPUnit scaffolding for a particular SUT (system under test).

Contributions Welcome
---------------------
Expand Down
27 changes: 27 additions & 0 deletions php-unit-test.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
php-stacktrace
Insert stacktrack in your error_log. This is useful if you need to quickly see the call stack for an unfamiliar peice of code that's deep within a system.

HOW TO USE
In your PHP class, simply type the following:

php-stack-trace<TAB>

Sublime Text will add the stacktrace code for you. Then use <TAB> to add a grep friendly token to your log message.
-->
<snippet>
<content><![CDATA[
require_once('${1:[Class Name (system under test) ... ]}.php');

class ${1:[Class Name (system under test) ... ]}Tests extends PHPUnit_Framework_TestCase
{
public function test${2:[SomeThingUsefulToTestGoesHere]}()
{
${3:// code...}
}
}
]]></content>
<tabTrigger>php-unit-test</tabTrigger>
<scope>source.php</scope>
<description>Generates PHPUnit scaffolding for a particular SUT (system under test).</description>
</snippet>