PageRenderTime 41ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/_helpers/_generated/CliTesterActions.php

https://gitlab.com/cornernote/yii2-gii
PHP | 489 lines | 89 code | 39 blank | 361 comment | 0 complexity | be5fd92102c3cdb0064a4e2dbff5613f MD5 | raw file
  1. <?php //[STAMP] c4e01b07b254dbff83924bac13d25a3b
  2. namespace _generated;
  3. // This class was automatically generated by build task
  4. // You should not change it manually as it will be overwritten on next build
  5. // @codingStandardsIgnoreFile
  6. use Codeception\Module\Filesystem;
  7. use Codeception\Module\Cli;
  8. trait CliTesterActions
  9. {
  10. /**
  11. * @return \Codeception\Scenario
  12. */
  13. abstract protected function getScenario();
  14. /**
  15. * [!] Method is generated. Documentation taken from corresponding module.
  16. *
  17. * Enters a directory In local filesystem.
  18. * Project root directory is used by default
  19. *
  20. * @param $path
  21. * @see \Codeception\Module\Filesystem::amInPath()
  22. */
  23. public function amInPath($path) {
  24. return $this->getScenario()->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
  25. }
  26. /**
  27. * [!] Method is generated. Documentation taken from corresponding module.
  28. *
  29. * Opens a file and stores it's content.
  30. *
  31. * Usage:
  32. *
  33. * ``` php
  34. * <?php
  35. * $I->openFile('composer.json');
  36. * $I->seeInThisFile('codeception/codeception');
  37. * ?>
  38. * ```
  39. *
  40. * @param $filename
  41. * @see \Codeception\Module\Filesystem::openFile()
  42. */
  43. public function openFile($filename) {
  44. return $this->getScenario()->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
  45. }
  46. /**
  47. * [!] Method is generated. Documentation taken from corresponding module.
  48. *
  49. * Deletes a file
  50. *
  51. * ``` php
  52. * <?php
  53. * $I->deleteFile('composer.lock');
  54. * ?>
  55. * ```
  56. *
  57. * @param $filename
  58. * @see \Codeception\Module\Filesystem::deleteFile()
  59. */
  60. public function deleteFile($filename) {
  61. return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
  62. }
  63. /**
  64. * [!] Method is generated. Documentation taken from corresponding module.
  65. *
  66. * Deletes directory with all subdirectories
  67. *
  68. * ``` php
  69. * <?php
  70. * $I->deleteDir('vendor');
  71. * ?>
  72. * ```
  73. *
  74. * @param $dirname
  75. * @see \Codeception\Module\Filesystem::deleteDir()
  76. */
  77. public function deleteDir($dirname) {
  78. return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
  79. }
  80. /**
  81. * [!] Method is generated. Documentation taken from corresponding module.
  82. *
  83. * Copies directory with all contents
  84. *
  85. * ``` php
  86. * <?php
  87. * $I->copyDir('vendor','old_vendor');
  88. * ?>
  89. * ```
  90. *
  91. * @param $src
  92. * @param $dst
  93. * @see \Codeception\Module\Filesystem::copyDir()
  94. */
  95. public function copyDir($src, $dst) {
  96. return $this->getScenario()->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
  97. }
  98. /**
  99. * [!] Method is generated. Documentation taken from corresponding module.
  100. *
  101. * Checks If opened file has `text` in it.
  102. *
  103. * Usage:
  104. *
  105. * ``` php
  106. * <?php
  107. * $I->openFile('composer.json');
  108. * $I->seeInThisFile('codeception/codeception');
  109. * ?>
  110. * ```
  111. *
  112. * @param $text
  113. * Conditional Assertion: Test won't be stopped on fail
  114. * @see \Codeception\Module\Filesystem::seeInThisFile()
  115. */
  116. public function canSeeInThisFile($text) {
  117. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
  118. }
  119. /**
  120. * [!] Method is generated. Documentation taken from corresponding module.
  121. *
  122. * Checks If opened file has `text` in it.
  123. *
  124. * Usage:
  125. *
  126. * ``` php
  127. * <?php
  128. * $I->openFile('composer.json');
  129. * $I->seeInThisFile('codeception/codeception');
  130. * ?>
  131. * ```
  132. *
  133. * @param $text
  134. * @see \Codeception\Module\Filesystem::seeInThisFile()
  135. */
  136. public function seeInThisFile($text) {
  137. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
  138. }
  139. /**
  140. * [!] Method is generated. Documentation taken from corresponding module.
  141. *
  142. * Checks If opened file has the `number` of new lines.
  143. *
  144. * Usage:
  145. *
  146. * ``` php
  147. * <?php
  148. * $I->openFile('composer.json');
  149. * $I->seeNumberNewLines(5);
  150. * ?>
  151. * ```
  152. *
  153. * @param int $number New lines
  154. * Conditional Assertion: Test won't be stopped on fail
  155. * @see \Codeception\Module\Filesystem::seeNumberNewLines()
  156. */
  157. public function canSeeNumberNewLines($number) {
  158. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeNumberNewLines', func_get_args()));
  159. }
  160. /**
  161. * [!] Method is generated. Documentation taken from corresponding module.
  162. *
  163. * Checks If opened file has the `number` of new lines.
  164. *
  165. * Usage:
  166. *
  167. * ``` php
  168. * <?php
  169. * $I->openFile('composer.json');
  170. * $I->seeNumberNewLines(5);
  171. * ?>
  172. * ```
  173. *
  174. * @param int $number New lines
  175. * @see \Codeception\Module\Filesystem::seeNumberNewLines()
  176. */
  177. public function seeNumberNewLines($number) {
  178. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeNumberNewLines', func_get_args()));
  179. }
  180. /**
  181. * [!] Method is generated. Documentation taken from corresponding module.
  182. *
  183. * Checks the strict matching of file contents.
  184. * Unlike `seeInThisFile` will fail if file has something more than expected lines.
  185. * Better to use with HEREDOC strings.
  186. * Matching is done after removing "\r" chars from file content.
  187. *
  188. * ``` php
  189. * <?php
  190. * $I->openFile('process.pid');
  191. * $I->seeFileContentsEqual('3192');
  192. * ?>
  193. * ```
  194. *
  195. * @param $text
  196. * Conditional Assertion: Test won't be stopped on fail
  197. * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
  198. */
  199. public function canSeeFileContentsEqual($text) {
  200. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
  201. }
  202. /**
  203. * [!] Method is generated. Documentation taken from corresponding module.
  204. *
  205. * Checks the strict matching of file contents.
  206. * Unlike `seeInThisFile` will fail if file has something more than expected lines.
  207. * Better to use with HEREDOC strings.
  208. * Matching is done after removing "\r" chars from file content.
  209. *
  210. * ``` php
  211. * <?php
  212. * $I->openFile('process.pid');
  213. * $I->seeFileContentsEqual('3192');
  214. * ?>
  215. * ```
  216. *
  217. * @param $text
  218. * @see \Codeception\Module\Filesystem::seeFileContentsEqual()
  219. */
  220. public function seeFileContentsEqual($text) {
  221. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
  222. }
  223. /**
  224. * [!] Method is generated. Documentation taken from corresponding module.
  225. *
  226. * Checks If opened file doesn't contain `text` in it
  227. *
  228. * ``` php
  229. * <?php
  230. * $I->openFile('composer.json');
  231. * $I->dontSeeInThisFile('codeception/codeception');
  232. * ?>
  233. * ```
  234. *
  235. * @param $text
  236. * Conditional Assertion: Test won't be stopped on fail
  237. * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
  238. */
  239. public function cantSeeInThisFile($text) {
  240. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
  241. }
  242. /**
  243. * [!] Method is generated. Documentation taken from corresponding module.
  244. *
  245. * Checks If opened file doesn't contain `text` in it
  246. *
  247. * ``` php
  248. * <?php
  249. * $I->openFile('composer.json');
  250. * $I->dontSeeInThisFile('codeception/codeception');
  251. * ?>
  252. * ```
  253. *
  254. * @param $text
  255. * @see \Codeception\Module\Filesystem::dontSeeInThisFile()
  256. */
  257. public function dontSeeInThisFile($text) {
  258. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
  259. }
  260. /**
  261. * [!] Method is generated. Documentation taken from corresponding module.
  262. *
  263. * Deletes a file
  264. * @see \Codeception\Module\Filesystem::deleteThisFile()
  265. */
  266. public function deleteThisFile() {
  267. return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
  268. }
  269. /**
  270. * [!] Method is generated. Documentation taken from corresponding module.
  271. *
  272. * Checks if file exists in path.
  273. * Opens a file when it's exists
  274. *
  275. * ``` php
  276. * <?php
  277. * $I->seeFileFound('UserModel.php','app/models');
  278. * ?>
  279. * ```
  280. *
  281. * @param $filename
  282. * @param string $path
  283. * Conditional Assertion: Test won't be stopped on fail
  284. * @see \Codeception\Module\Filesystem::seeFileFound()
  285. */
  286. public function canSeeFileFound($filename, $path = null) {
  287. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
  288. }
  289. /**
  290. * [!] Method is generated. Documentation taken from corresponding module.
  291. *
  292. * Checks if file exists in path.
  293. * Opens a file when it's exists
  294. *
  295. * ``` php
  296. * <?php
  297. * $I->seeFileFound('UserModel.php','app/models');
  298. * ?>
  299. * ```
  300. *
  301. * @param $filename
  302. * @param string $path
  303. * @see \Codeception\Module\Filesystem::seeFileFound()
  304. */
  305. public function seeFileFound($filename, $path = null) {
  306. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
  307. }
  308. /**
  309. * [!] Method is generated. Documentation taken from corresponding module.
  310. *
  311. * Checks if file does not exist in path
  312. *
  313. * @param $filename
  314. * @param string $path
  315. * Conditional Assertion: Test won't be stopped on fail
  316. * @see \Codeception\Module\Filesystem::dontSeeFileFound()
  317. */
  318. public function cantSeeFileFound($filename, $path = null) {
  319. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
  320. }
  321. /**
  322. * [!] Method is generated. Documentation taken from corresponding module.
  323. *
  324. * Checks if file does not exist in path
  325. *
  326. * @param $filename
  327. * @param string $path
  328. * @see \Codeception\Module\Filesystem::dontSeeFileFound()
  329. */
  330. public function dontSeeFileFound($filename, $path = null) {
  331. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
  332. }
  333. /**
  334. * [!] Method is generated. Documentation taken from corresponding module.
  335. *
  336. * Erases directory contents
  337. *
  338. * ``` php
  339. * <?php
  340. * $I->cleanDir('logs');
  341. * ?>
  342. * ```
  343. *
  344. * @param $dirname
  345. * @see \Codeception\Module\Filesystem::cleanDir()
  346. */
  347. public function cleanDir($dirname) {
  348. return $this->getScenario()->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
  349. }
  350. /**
  351. * [!] Method is generated. Documentation taken from corresponding module.
  352. *
  353. * Saves contents to file
  354. *
  355. * @param $filename
  356. * @param $contents
  357. * @see \Codeception\Module\Filesystem::writeToFile()
  358. */
  359. public function writeToFile($filename, $contents) {
  360. return $this->getScenario()->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
  361. }
  362. /**
  363. * [!] Method is generated. Documentation taken from corresponding module.
  364. *
  365. * Executes a shell command.
  366. * Fails If exit code is > 0. You can disable this by setting second parameter to false
  367. *
  368. * ```php
  369. * <?php
  370. * $I->runShellCommand('phpunit');
  371. *
  372. * // do not fail test when command fails
  373. * $I->runShellCommand('phpunit', false);
  374. * ```
  375. *
  376. * @param $command
  377. * @param bool $failNonZero
  378. * @see \Codeception\Module\Cli::runShellCommand()
  379. */
  380. public function runShellCommand($command, $failNonZero = null) {
  381. return $this->getScenario()->runStep(new \Codeception\Step\Action('runShellCommand', func_get_args()));
  382. }
  383. /**
  384. * [!] Method is generated. Documentation taken from corresponding module.
  385. *
  386. * Checks that output from last executed command contains text
  387. *
  388. * @param $text
  389. * Conditional Assertion: Test won't be stopped on fail
  390. * @see \Codeception\Module\Cli::seeInShellOutput()
  391. */
  392. public function canSeeInShellOutput($text) {
  393. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInShellOutput', func_get_args()));
  394. }
  395. /**
  396. * [!] Method is generated. Documentation taken from corresponding module.
  397. *
  398. * Checks that output from last executed command contains text
  399. *
  400. * @param $text
  401. * @see \Codeception\Module\Cli::seeInShellOutput()
  402. */
  403. public function seeInShellOutput($text) {
  404. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInShellOutput', func_get_args()));
  405. }
  406. /**
  407. * [!] Method is generated. Documentation taken from corresponding module.
  408. *
  409. * Checks that output from latest command doesn't contain text
  410. *
  411. * @param $text
  412. *
  413. * Conditional Assertion: Test won't be stopped on fail
  414. * @see \Codeception\Module\Cli::dontSeeInShellOutput()
  415. */
  416. public function cantSeeInShellOutput($text) {
  417. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInShellOutput', func_get_args()));
  418. }
  419. /**
  420. * [!] Method is generated. Documentation taken from corresponding module.
  421. *
  422. * Checks that output from latest command doesn't contain text
  423. *
  424. * @param $text
  425. *
  426. * @see \Codeception\Module\Cli::dontSeeInShellOutput()
  427. */
  428. public function dontSeeInShellOutput($text) {
  429. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeInShellOutput', func_get_args()));
  430. }
  431. /**
  432. * [!] Method is generated. Documentation taken from corresponding module.
  433. *
  434. *
  435. * Conditional Assertion: Test won't be stopped on fail
  436. * @see \Codeception\Module\Cli::seeShellOutputMatches()
  437. */
  438. public function canSeeShellOutputMatches($regex) {
  439. return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeShellOutputMatches', func_get_args()));
  440. }
  441. /**
  442. * [!] Method is generated. Documentation taken from corresponding module.
  443. *
  444. *
  445. * @see \Codeception\Module\Cli::seeShellOutputMatches()
  446. */
  447. public function seeShellOutputMatches($regex) {
  448. return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeShellOutputMatches', func_get_args()));
  449. }
  450. }