PageRenderTime 24ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/node_modules/grunt-phpunit/README.md

https://gitlab.com/andrewchng/cSystem
Markdown | 264 lines | 165 code | 99 blank | 0 comment | 0 complexity | b69016b6bee579042d878e6ba7cb38d8 MD5 | raw file
  1. # grunt-phpunit
  2. > Grunt plugin for running phpunit.
  3. ##Getting Started
  4. This plugin requires Grunt `0.4.0`.
  5. If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins.
  6. 1. Install this grunt plugin with the following command:
  7. ```shell
  8. npm install grunt-phpunit --save-dev
  9. ```
  10. 2. [Install phpunit](https://github.com/sebastianbergmann/phpunit/#installation) (preferably with [composer](https://github.com/composer/composer))
  11. ```shell
  12. composer install
  13. ```
  14. 3. Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
  15. ```js
  16. grunt.loadNpmTasks('grunt-phpunit');
  17. ```
  18. ##PHPUnit task
  19. _Run this task with the `grunt phpunit` command._
  20. ###Usage Example
  21. ```js
  22. phpunit: {
  23. classes: {
  24. dir: 'tests/php/'
  25. },
  26. options: {
  27. bin: 'vendor/bin/phpunit',
  28. bootstrap: 'tests/php/phpunit.php',
  29. colors: true
  30. }
  31. }
  32. ```
  33. ###Target Properties
  34. ####dir
  35. Type: `String`
  36. The directory where phpunit should be run, i.e. where the test classes and the bootstrap are located in.
  37. ###Options
  38. ####bin
  39. Type: `String` Default: `'phpunit'`
  40. The executable binary.
  41. ####logJunit
  42. Type: `String` Default: `false`
  43. Log test execution in JUnit XML format to file.
  44. ####logTap
  45. Type: `String` Default: `false`
  46. Log test execution in TAP format to file.
  47. ####logJson
  48. Type: `String` Default: `false`
  49. Log test execution in JSON format.
  50. ####coverageClover
  51. Type: `String` Default: `false`
  52. Generate code coverage report in Clover XML format.
  53. ####coverageHtml
  54. Type: `String` Default: `false`
  55. Generate code coverage report in HTML format.
  56. ####coveragePhp
  57. Type: `String` Default: `false`
  58. Serialize PHP_CodeCoverage object to file.
  59. ####coverage (or coverageText)
  60. Type: `Boolean` Default: `false`
  61. Generate code coverage report in text format. Default to writing to the standard output. This option can also be set by running the task with `--coverage`.
  62. ####testsuite
  63. Type: `String` Default: `false`
  64. Filter which testsuite to run.
  65. ####testSuffix
  66. Type: `String` Default: `false`
  67. Only search for test in files with specified suffix(es).
  68. ####testdox
  69. Type: `Boolean` Default: `false`
  70. Report test execution progress in TestDox format. This option can also be set by running the task with `--testdox`.
  71. ####testdoxHtml
  72. Type: `String` Default: `false`
  73. Write agile documentation in HTML format to file.
  74. ####testdoxText
  75. Type: `String` Default: `false`
  76. Write agile documentation in Text format to file.
  77. ####filter
  78. Type: `String` Default: `false`
  79. Filter which tests to run.
  80. ####group
  81. Type: `String` Default: `false`
  82. Only runs tests from the specified group(s).
  83. ####excludeGroup
  84. Type: `String` Default: `false`
  85. Exclude tests from the specified group(s).
  86. ####listGroups
  87. Type: `Boolean` Default: `false`
  88. List available test groups. This option can also be set by running the task with `--list-groups`.
  89. ####loader
  90. Type: `String` Default: `false`
  91. TestSuiteLoader implementation to use.
  92. ####printer
  93. Type: `String` Default: `false`
  94. TestSuiteListener implementation to use.
  95. ####repeat
  96. Type: `String` Default: `false`
  97. Runs the test(s) repeatedly.
  98. ####tap
  99. Type: `Boolean` Default: `false`
  100. Report test execution progress in TAP format. This option can also be set by running the task with `--tap`.
  101. ####colors
  102. Type: `Boolean` Default: `false`
  103. Use colors in output. This option can also be set by running the task with `--colors`.
  104. ####stderr
  105. Type: `Boolean` Default: `false`
  106. Write to STDERR instead of STDOUT. This option can also be set by running the task with `--stderr`.
  107. ####stopOnError
  108. Type: `Boolean` Default: `false`
  109. Stop execution upon first error. This option can also be set by running the task with `--stop-on-error`.
  110. ####stopOnFailure
  111. Type: `Boolean` Default: `false`
  112. Stop execution upon first error or failure. This option can also be set by running the task with `--stop-on-failure`.
  113. ####stopOnSkipped
  114. Type: `Boolean` Default: `false`
  115. Stop execution upon first skipped test. This option can also be set by running the task with `--stop-on-skipped`.
  116. ####stopOnIncomplete
  117. Type: `Boolean` Default: `false`
  118. Stop execution upon first incomplete test. This option can also be set by running the task with `--stop-on-incomplete`.
  119. ####strict
  120. Type: `Boolean` Default: `false`
  121. Run tests in strict mode. This option can also be set by running the task with `--strict`.
  122. ####verbose
  123. Type: `Boolean` Default: `false`
  124. Output more verbose information. This option can also be set by running the task with `--verbose`.
  125. ####debug
  126. Type: `Boolean` Default: `false`
  127. Display debbuging information during test execution. This option can also be set by running the task with `--debug`.
  128. ####processIsolation
  129. Type: `Boolean` Default: `false`
  130. Run each test in a separate PHP process. This option can also be set by running the task with `--process-isolation`.
  131. ####noGlobalsBackup
  132. Type: `Boolean` Default: `false`
  133. Do not backup and restore $GLOBALS for each test. This option can also be set by running the task with `--no-globals-backup`.
  134. ####staticBackup
  135. Type: `Boolean` Default: `false`
  136. Backup and restore static attributes for each test. This option can also be set by running the task with `--static-backup`.
  137. ####bootstrap
  138. Type: `String` Default: `false`
  139. A "bootstrap" PHP file that is run before the tests.
  140. ####configuration
  141. Type: `String` Default: `false`
  142. Read configuration from XML file.
  143. ####noConfiguration
  144. Type: `Boolean` Default: `false`
  145. Ignore default configuration file (phpunit.xml). This option can also be set by running the task with `--no-configuration`.
  146. ####includePath
  147. Type: `String` Default: `false`
  148. Prepend PHP's include_path with given path(s).
  149. ####d
  150. Type: `String` Default: `false`
  151. Sets a php.ini value.
  152. ####followOutput
  153. Type: `Boolean` Default: `false`
  154. Prints the output to the console immediately, instead of displaying the whole ouput at the end.
  155. This can be useful -combining with debug: true- when there are many long running tests.
  156. ####failOnFailures
  157. Type: `Boolean` Default: `false`
  158. Phpunit will return with exit code 1 when there are failed tests and wit exit code 2 when there are errors, and grunt will abort in this cases.
  159. When you want the task finish without aborting set failOnFailures to true.
  160. ####execMaxBuffer
  161. Type: `Integer` Default: `200*1024`
  162. Configure the Node JS `maxBuffer` option passed to the
  163. [`exec`](http://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) function.
  164. This can be useful if you need to run a large test suite which outputs lot of logs, otherwise you could encounter a
  165. `Fatal error: stdout maxBuffer exceeded.` error. See issue [#29](https://github.com/SaschaGalley/grunt-phpunit/issues/29) for more informations about this.