![]() |
|
sfDocTestPlugin - 0.2.4This plugin enable DocTest with symfony |
|
![]() |
2
users
Sign-in
to change your status |
This plugin enable DocTest with symfony |
This plugin provide "Doc Test" feature what you can write test codes in the code.
| Name | Status | |
|---|---|---|
|
|
lead | moc.liamg <<ta>> arahakat.y |
Copyright (c) 2007-2009 TAKAHARA Yoshihiro <y dot takahara at gmail dot com>
Copyright (c) 2007-2009 Dino Co.,Ltd. http://www.dino.co.jp
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Version | License | API | Released |
|---|---|---|---|
| 0.2.8stable | MIT license | 0.2.0stable | 02/12/2009 |
| 0.2.6stable | MIT license | 0.2.0stable | 25/05/2009 |
| 0.2.5stable | MIT license | 0.2.0stable | 18/05/2009 |
| 0.2.4stable | MIT license | 0.2.0stable | 12/05/2009 |
| 0.2.3stable | MIT license | 0.2.0stable | 12/05/2009 |
| Version | License | API | Released |
|---|---|---|---|
| 0.2.8stable | MIT license | 0.2.0stable | 02/12/2009 |
| 0.2.6stable | MIT license | 0.2.0stable | 25/05/2009 |
| 0.2.5stable | MIT license | 0.2.0stable | 18/05/2009 |
| 0.2.4stable | MIT license | 0.2.0stable | 12/05/2009 |
| 0.2.3stable | MIT license | 0.2.0stable | 12/05/2009 |
| Version | License | API | Released |
|---|---|---|---|
| 0.2.8stable | MIT license | 0.2.0stable | 02/12/2009 |
| 0.2.6stable | MIT license | 0.2.0stable | 25/05/2009 |
| 0.2.5stable | MIT license | 0.2.0stable | 18/05/2009 |
| 0.2.4stable | MIT license | 0.2.0stable | 12/05/2009 |
| 0.2.3stable | MIT license | 0.2.0stable | 12/05/2009 |
sfDocTestPlugin enables DocTest which place tests in doc comments.
symfony 1.0
symfony 1.2
symfony 1.0
$ php symfony plugin-install http://plugins.symfony-project.com/sfDocTestPlugin
symfony 1.2
$ php symfony plugin:install sfDocTestPlugin
Checkout from Subversion repository as follows:
cd plugins
svn co http://svn.tracfort.jp/svn/dino-symfony/plugins/sfDocTestPlugin
cd - && symfony cc
Or, download or install attached file.
symfony test:doctest frontend
or
symfony test:doctest frontend target-file-name.class.php
You can set configuration in ${SF_PROJECT_DIR}/config/doctest.yml file.
default:
app: frontend
env: test
in: [apps, lib]
prune: [validator, templates]
plugins:
app: frontend
env: test
in: [plugins]
prune: [validator, templates]
pre-release-check:
app: frontend
env: test
in: [apps, lib]
prune: [validator, templates]
All test will be passwd when test has not implemented yet. Test cases must write in doc-commment (from /** to */) as follows:
/** * #test * <code> * #is(emphasis("great"),"great!!","add !! emphasised."); * </code> * */ function emphasis($word){ // function has not implemented yet. }
DocTest expand as test case After #test.#is is map to lime_test class method ->is().
Execute this test.
symfony doctest frontend emphasis-1.php
Result:
[[Image(emphasis-1.png)]]
It fails as you expects.
/** * #test * <code> * #is(emphasis("great"),"great!!","add !! emphasised."); * </code> * */ function emphasis($word){ return $word."!!"; }
It is to be Success.
symfony doctest frontend emphasis-2.php
[[Image(emphasis-2.png)]]
syomfony doctest-coverage "test or app" [file1 file2 file3 ...]
