PageRenderTime 53ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/cli/CliGuy.php

https://github.com/instalic/Codeception
PHP | 323 lines | 112 code | 29 blank | 182 comment | 13 complexity | bfa5be80e4ecd50656759601c6b348e2 MD5 | raw file
  1. <?php
  2. // This class was automatically generated by build task
  3. // You can change it manually, but it will be overwritten on next build
  4. use Codeception\Maybe;
  5. use Codeception\Module\Filesystem;
  6. use Codeception\Module\Cli;
  7. use Codeception\Module\CliHelper;
  8. /**
  9. * Inherited methods
  10. * @method void wantToTest($text)
  11. * @method void wantTo($text)
  12. * @method void amTesting($method)
  13. * @method void amTestingMethod($method)
  14. * @method void testMethod($signature)
  15. * @method void expectTo($prediction)
  16. * @method void expect($prediction)
  17. * @method void amGoingTo($argumentation)
  18. * @method void am($role)
  19. * @method void lookForwardTo($role)
  20. */
  21. class CliGuy extends \Codeception\AbstractGuy
  22. {
  23. /**
  24. * Enters a directory In local filesystem.
  25. * Project root directory is used by default
  26. *
  27. * @param $path
  28. * @see Filesystem::amInPath()
  29. *
  30. * ! This method is generated. DO NOT EDIT. !
  31. * ! Documentation taken from corresponding module !
  32. */
  33. public function amInPath($path) {
  34. $this->scenario->condition('amInPath', func_get_args());
  35. if ($this->scenario->running()) {
  36. $result = $this->scenario->runStep();
  37. return new Maybe($result);
  38. }
  39. return new Maybe();
  40. }
  41. /**
  42. * Opens a file and stores it's content.
  43. *
  44. * Usage:
  45. *
  46. * ``` php
  47. * <?php
  48. * $I->openFile('composer.json');
  49. * $I->seeInThisFile('codeception/codeception');
  50. * ?>
  51. * ```
  52. *
  53. * @param $filename
  54. * @see Filesystem::openFile()
  55. *
  56. * ! This method is generated. DO NOT EDIT. !
  57. * ! Documentation taken from corresponding module !
  58. */
  59. public function openFile($filename) {
  60. $this->scenario->action('openFile', func_get_args());
  61. if ($this->scenario->running()) {
  62. $result = $this->scenario->runStep();
  63. return new Maybe($result);
  64. }
  65. return new Maybe();
  66. }
  67. /**
  68. * Deletes a file
  69. *
  70. * ``` php
  71. * <?php
  72. * $I->deleteFile('composer.lock');
  73. * ?>
  74. * ```
  75. *
  76. * @param $filename
  77. * @see Filesystem::deleteFile()
  78. *
  79. * ! This method is generated. DO NOT EDIT. !
  80. * ! Documentation taken from corresponding module !
  81. */
  82. public function deleteFile($filename) {
  83. $this->scenario->action('deleteFile', func_get_args());
  84. if ($this->scenario->running()) {
  85. $result = $this->scenario->runStep();
  86. return new Maybe($result);
  87. }
  88. return new Maybe();
  89. }
  90. /**
  91. * Deletes directory with all subdirectories
  92. *
  93. * ``` php
  94. * <?php
  95. * $I->deleteDir('vendor');
  96. * ?>
  97. * ```
  98. *
  99. * @param $dirname
  100. * @see Filesystem::deleteDir()
  101. *
  102. * ! This method is generated. DO NOT EDIT. !
  103. * ! Documentation taken from corresponding module !
  104. */
  105. public function deleteDir($dirname) {
  106. $this->scenario->action('deleteDir', func_get_args());
  107. if ($this->scenario->running()) {
  108. $result = $this->scenario->runStep();
  109. return new Maybe($result);
  110. }
  111. return new Maybe();
  112. }
  113. /**
  114. * Copies directory with all contents
  115. *
  116. * ``` php
  117. * <?php
  118. * $I->copyDir('vendor','old_vendor');
  119. * ?>
  120. * ```
  121. *
  122. * @param $src
  123. * @param $dst
  124. * @see Filesystem::copyDir()
  125. *
  126. * ! This method is generated. DO NOT EDIT. !
  127. * ! Documentation taken from corresponding module !
  128. */
  129. public function copyDir($src, $dst) {
  130. $this->scenario->action('copyDir', func_get_args());
  131. if ($this->scenario->running()) {
  132. $result = $this->scenario->runStep();
  133. return new Maybe($result);
  134. }
  135. return new Maybe();
  136. }
  137. /**
  138. * Checks If opened file has `text` in it.
  139. *
  140. * Usage:
  141. *
  142. * ``` php
  143. * <?php
  144. * $I->openFile('composer.json');
  145. * $I->seeInThisFile('codeception/codeception');
  146. * ?>
  147. * ```
  148. *
  149. * @param $text
  150. * @see Filesystem::seeInThisFile()
  151. *
  152. * ! This method is generated. DO NOT EDIT. !
  153. * ! Documentation taken from corresponding module !
  154. */
  155. public function seeInThisFile($text) {
  156. $this->scenario->assertion('seeInThisFile', func_get_args());
  157. if ($this->scenario->running()) {
  158. $result = $this->scenario->runStep();
  159. return new Maybe($result);
  160. }
  161. return new Maybe();
  162. }
  163. /**
  164. * Checks If opened file doesn't contain `text` in it
  165. *
  166. * ``` php
  167. * <?php
  168. * $I->openFile('composer.json');
  169. * $I->seeInThisFile('codeception/codeception');
  170. * ?>
  171. * ```
  172. *
  173. * @param $text
  174. * @see Filesystem::dontSeeInThisFile()
  175. *
  176. * ! This method is generated. DO NOT EDIT. !
  177. * ! Documentation taken from corresponding module !
  178. */
  179. public function dontSeeInThisFile($text) {
  180. $this->scenario->action('dontSeeInThisFile', func_get_args());
  181. if ($this->scenario->running()) {
  182. $result = $this->scenario->runStep();
  183. return new Maybe($result);
  184. }
  185. return new Maybe();
  186. }
  187. /**
  188. * Deletes a file
  189. * @see Filesystem::deleteThisFile()
  190. *
  191. * ! This method is generated. DO NOT EDIT. !
  192. * ! Documentation taken from corresponding module !
  193. */
  194. public function deleteThisFile() {
  195. $this->scenario->action('deleteThisFile', func_get_args());
  196. if ($this->scenario->running()) {
  197. $result = $this->scenario->runStep();
  198. return new Maybe($result);
  199. }
  200. return new Maybe();
  201. }
  202. /**
  203. * Checks if file exists in path.
  204. * Opens a file when it's exists
  205. *
  206. * ``` php
  207. * <?php
  208. * $I->seeFileFound('UserModel.php','app/models');
  209. * ?>
  210. * ```
  211. *
  212. * @param $filename
  213. * @param string $path
  214. * @see Filesystem::seeFileFound()
  215. *
  216. * ! This method is generated. DO NOT EDIT. !
  217. * ! Documentation taken from corresponding module !
  218. */
  219. public function seeFileFound($filename, $path = null) {
  220. $this->scenario->assertion('seeFileFound', func_get_args());
  221. if ($this->scenario->running()) {
  222. $result = $this->scenario->runStep();
  223. return new Maybe($result);
  224. }
  225. return new Maybe();
  226. }
  227. /**
  228. * Executes a shell command
  229. *
  230. * @param $command
  231. * @see Cli::runShellCommmand()
  232. *
  233. * ! This method is generated. DO NOT EDIT. !
  234. * ! Documentation taken from corresponding module !
  235. */
  236. public function runShellCommmand($command) {
  237. $this->scenario->action('runShellCommmand', func_get_args());
  238. if ($this->scenario->running()) {
  239. $result = $this->scenario->runStep();
  240. return new Maybe($result);
  241. }
  242. return new Maybe();
  243. }
  244. /**
  245. * Checks that output from last executed command contains text
  246. *
  247. * @param $text
  248. * @see Cli::seeInShellOutput()
  249. *
  250. * ! This method is generated. DO NOT EDIT. !
  251. * ! Documentation taken from corresponding module !
  252. */
  253. public function seeInShellOutput($text) {
  254. $this->scenario->assertion('seeInShellOutput', func_get_args());
  255. if ($this->scenario->running()) {
  256. $result = $this->scenario->runStep();
  257. return new Maybe($result);
  258. }
  259. return new Maybe();
  260. }
  261. /**
  262. * Checks that output from latest command doesn't contain text
  263. *
  264. * @param $text
  265. *
  266. * @see Cli::dontSeeInShellOutput()
  267. *
  268. * ! This method is generated. DO NOT EDIT. !
  269. * ! Documentation taken from corresponding module !
  270. */
  271. public function dontSeeInShellOutput($text) {
  272. $this->scenario->action('dontSeeInShellOutput', func_get_args());
  273. if ($this->scenario->running()) {
  274. $result = $this->scenario->runStep();
  275. return new Maybe($result);
  276. }
  277. return new Maybe();
  278. }
  279. /**
  280. *
  281. * @see CliHelper::executeCommand()
  282. *
  283. * ! This method is generated. DO NOT EDIT. !
  284. * ! Documentation taken from corresponding module !
  285. */
  286. public function executeCommand($command) {
  287. $this->scenario->action('executeCommand', func_get_args());
  288. if ($this->scenario->running()) {
  289. $result = $this->scenario->runStep();
  290. return new Maybe($result);
  291. }
  292. return new Maybe();
  293. }
  294. }