/vendor/schmunk42/yii2-giiant/tests/cli/CliTester.php

https://gitlab.com/febfeb/pelatihan-git · PHP · 468 lines · 85 code · 39 blank · 344 comment · 0 complexity · 8439e68a7b517364c68844de8442f6e8 MD5 · raw file

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