/protected/vendor/schmunk42/yii2-giiant/tests/_helpers/_generated/UnitTesterActions.php

https://gitlab.com/I-NOZex/quiz · PHP · 481 lines · 103 code · 67 blank · 311 comment · 0 complexity · a4e523d66817a2073f2ce0e12704fa77 MD5 · raw file

  1. <?php //[STAMP] 5b78a31c5f5568600590c4982f73333b
  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\Asserts;
  7. trait UnitTesterActions
  8. {
  9. /**
  10. * @return \Codeception\Scenario
  11. */
  12. abstract protected function getScenario();
  13. /**
  14. * [!] Method is generated. Documentation taken from corresponding module.
  15. *
  16. * Checks that two variables are equal.
  17. *
  18. * @param $expected
  19. * @param $actual
  20. * @param string $message
  21. * @see \Codeception\Module\Asserts::assertEquals()
  22. */
  23. public function assertEquals($expected, $actual, $message = null) {
  24. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
  25. }
  26. /**
  27. * [!] Method is generated. Documentation taken from corresponding module.
  28. *
  29. * Checks that two variables are not equal
  30. *
  31. * @param $expected
  32. * @param $actual
  33. * @param string $message
  34. * @see \Codeception\Module\Asserts::assertNotEquals()
  35. */
  36. public function assertNotEquals($expected, $actual, $message = null) {
  37. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
  38. }
  39. /**
  40. * [!] Method is generated. Documentation taken from corresponding module.
  41. *
  42. * Checks that two variables are same
  43. *
  44. * @param $expected
  45. * @param $actual
  46. * @param string $message
  47. * @return mixed|void
  48. * @see \Codeception\Module\Asserts::assertSame()
  49. */
  50. public function assertSame($expected, $actual, $message = null) {
  51. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
  52. }
  53. /**
  54. * [!] Method is generated. Documentation taken from corresponding module.
  55. *
  56. * Checks that two variables are not same
  57. *
  58. * @param $expected
  59. * @param $actual
  60. * @param string $message
  61. * @see \Codeception\Module\Asserts::assertNotSame()
  62. */
  63. public function assertNotSame($expected, $actual, $message = null) {
  64. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
  65. }
  66. /**
  67. * [!] Method is generated. Documentation taken from corresponding module.
  68. *
  69. * Checks that actual is greater than expected
  70. *
  71. * @param $expected
  72. * @param $actual
  73. * @param string $message
  74. * @see \Codeception\Module\Asserts::assertGreaterThan()
  75. */
  76. public function assertGreaterThan($expected, $actual, $message = null) {
  77. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
  78. }
  79. /**
  80. * [!] Method is generated. Documentation taken from corresponding module.
  81. *
  82. * @deprecated
  83. * @see \Codeception\Module\Asserts::assertGreaterThen()
  84. */
  85. public function assertGreaterThen($expected, $actual, $message = null) {
  86. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThen', func_get_args()));
  87. }
  88. /**
  89. * [!] Method is generated. Documentation taken from corresponding module.
  90. *
  91. * Checks that actual is greater or equal than expected
  92. *
  93. * @param $expected
  94. * @param $actual
  95. * @param string $message
  96. * @see \Codeception\Module\Asserts::assertGreaterThanOrEqual()
  97. */
  98. public function assertGreaterThanOrEqual($expected, $actual, $message = null) {
  99. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
  100. }
  101. /**
  102. * [!] Method is generated. Documentation taken from corresponding module.
  103. *
  104. * @deprecated
  105. * @see \Codeception\Module\Asserts::assertGreaterThenOrEqual()
  106. */
  107. public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
  108. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThenOrEqual', func_get_args()));
  109. }
  110. /**
  111. * [!] Method is generated. Documentation taken from corresponding module.
  112. *
  113. * Checks that actual is less than expected
  114. *
  115. * @param $expected
  116. * @param $actual
  117. * @param string $message
  118. * @see \Codeception\Module\Asserts::assertLessThan()
  119. */
  120. public function assertLessThan($expected, $actual, $message = null) {
  121. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
  122. }
  123. /**
  124. * [!] Method is generated. Documentation taken from corresponding module.
  125. *
  126. * Checks that actual is less or equal than expected
  127. *
  128. * @param $expected
  129. * @param $actual
  130. * @param string $message
  131. * @see \Codeception\Module\Asserts::assertLessThanOrEqual()
  132. */
  133. public function assertLessThanOrEqual($expected, $actual, $message = null) {
  134. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
  135. }
  136. /**
  137. * [!] Method is generated. Documentation taken from corresponding module.
  138. *
  139. * Checks that haystack contains needle
  140. *
  141. * @param $needle
  142. * @param $haystack
  143. * @param string $message
  144. * @see \Codeception\Module\Asserts::assertContains()
  145. */
  146. public function assertContains($needle, $haystack, $message = null) {
  147. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
  148. }
  149. /**
  150. * [!] Method is generated. Documentation taken from corresponding module.
  151. *
  152. * Checks that haystack doesn't contain needle.
  153. *
  154. * @param $needle
  155. * @param $haystack
  156. * @param string $message
  157. * @see \Codeception\Module\Asserts::assertNotContains()
  158. */
  159. public function assertNotContains($needle, $haystack, $message = null) {
  160. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
  161. }
  162. /**
  163. * [!] Method is generated. Documentation taken from corresponding module.
  164. *
  165. * Checks that string match with pattern
  166. *
  167. * @param string $pattern
  168. * @param string $string
  169. * @param string $message
  170. * @see \Codeception\Module\Asserts::assertRegExp()
  171. */
  172. public function assertRegExp($pattern, $string, $message = null) {
  173. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args()));
  174. }
  175. /**
  176. * [!] Method is generated. Documentation taken from corresponding module.
  177. *
  178. * Checks that string not match with pattern
  179. *
  180. * @param string $pattern
  181. * @param string $string
  182. * @param string $message
  183. * @see \Codeception\Module\Asserts::assertNotRegExp()
  184. */
  185. public function assertNotRegExp($pattern, $string, $message = null) {
  186. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args()));
  187. }
  188. /**
  189. * [!] Method is generated. Documentation taken from corresponding module.
  190. *
  191. * Checks that variable is empty.
  192. *
  193. * @param $actual
  194. * @param string $message
  195. * @see \Codeception\Module\Asserts::assertEmpty()
  196. */
  197. public function assertEmpty($actual, $message = null) {
  198. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
  199. }
  200. /**
  201. * [!] Method is generated. Documentation taken from corresponding module.
  202. *
  203. * Checks that variable is not empty.
  204. *
  205. * @param $actual
  206. * @param string $message
  207. * @see \Codeception\Module\Asserts::assertNotEmpty()
  208. */
  209. public function assertNotEmpty($actual, $message = null) {
  210. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
  211. }
  212. /**
  213. * [!] Method is generated. Documentation taken from corresponding module.
  214. *
  215. * Checks that variable is NULL
  216. *
  217. * @param $actual
  218. * @param string $message
  219. * @see \Codeception\Module\Asserts::assertNull()
  220. */
  221. public function assertNull($actual, $message = null) {
  222. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
  223. }
  224. /**
  225. * [!] Method is generated. Documentation taken from corresponding module.
  226. *
  227. * Checks that variable is not NULL
  228. *
  229. * @param $actual
  230. * @param string $message
  231. * @see \Codeception\Module\Asserts::assertNotNull()
  232. */
  233. public function assertNotNull($actual, $message = null) {
  234. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
  235. }
  236. /**
  237. * [!] Method is generated. Documentation taken from corresponding module.
  238. *
  239. * Checks that condition is positive.
  240. *
  241. * @param $condition
  242. * @param string $message
  243. * @see \Codeception\Module\Asserts::assertTrue()
  244. */
  245. public function assertTrue($condition, $message = null) {
  246. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
  247. }
  248. /**
  249. * [!] Method is generated. Documentation taken from corresponding module.
  250. *
  251. * Checks that condition is negative.
  252. *
  253. * @param $condition
  254. * @param string $message
  255. * @see \Codeception\Module\Asserts::assertFalse()
  256. */
  257. public function assertFalse($condition, $message = null) {
  258. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
  259. }
  260. /**
  261. * [!] Method is generated. Documentation taken from corresponding module.
  262. *
  263. * Checks if file exists
  264. *
  265. * @param string $filename
  266. * @param string $message
  267. * @see \Codeception\Module\Asserts::assertFileExists()
  268. */
  269. public function assertFileExists($filename, $message = null) {
  270. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args()));
  271. }
  272. /**
  273. * [!] Method is generated. Documentation taken from corresponding module.
  274. *
  275. * Checks if file doesn't exist
  276. *
  277. * @param string $filename
  278. * @param string $message
  279. * @see \Codeception\Module\Asserts::assertFileNotExists()
  280. */
  281. public function assertFileNotExists($filename, $message = null) {
  282. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args()));
  283. }
  284. /**
  285. * [!] Method is generated. Documentation taken from corresponding module.
  286. *
  287. * @param $expected
  288. * @param $actual
  289. * @param $description
  290. * @see \Codeception\Module\Asserts::assertGreaterOrEquals()
  291. */
  292. public function assertGreaterOrEquals($expected, $actual, $description = null) {
  293. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
  294. }
  295. /**
  296. * [!] Method is generated. Documentation taken from corresponding module.
  297. *
  298. * @param $expected
  299. * @param $actual
  300. * @param $description
  301. * @see \Codeception\Module\Asserts::assertLessOrEquals()
  302. */
  303. public function assertLessOrEquals($expected, $actual, $description = null) {
  304. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
  305. }
  306. /**
  307. * [!] Method is generated. Documentation taken from corresponding module.
  308. *
  309. * @param $actual
  310. * @param $description
  311. * @see \Codeception\Module\Asserts::assertIsEmpty()
  312. */
  313. public function assertIsEmpty($actual, $description = null) {
  314. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
  315. }
  316. /**
  317. * [!] Method is generated. Documentation taken from corresponding module.
  318. *
  319. * @param $key
  320. * @param $actual
  321. * @param $description
  322. * @see \Codeception\Module\Asserts::assertArrayHasKey()
  323. */
  324. public function assertArrayHasKey($key, $actual, $description = null) {
  325. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
  326. }
  327. /**
  328. * [!] Method is generated. Documentation taken from corresponding module.
  329. *
  330. * @param $key
  331. * @param $actual
  332. * @param $description
  333. * @see \Codeception\Module\Asserts::assertArrayNotHasKey()
  334. */
  335. public function assertArrayNotHasKey($key, $actual, $description = null) {
  336. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
  337. }
  338. /**
  339. * [!] Method is generated. Documentation taken from corresponding module.
  340. *
  341. * @param $class
  342. * @param $actual
  343. * @param $description
  344. * @see \Codeception\Module\Asserts::assertInstanceOf()
  345. */
  346. public function assertInstanceOf($class, $actual, $description = null) {
  347. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args()));
  348. }
  349. /**
  350. * [!] Method is generated. Documentation taken from corresponding module.
  351. *
  352. * @param $class
  353. * @param $actual
  354. * @param $description
  355. * @see \Codeception\Module\Asserts::assertNotInstanceOf()
  356. */
  357. public function assertNotInstanceOf($class, $actual, $description = null) {
  358. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
  359. }
  360. /**
  361. * [!] Method is generated. Documentation taken from corresponding module.
  362. *
  363. * @param $type
  364. * @param $actual
  365. * @param $description
  366. * @see \Codeception\Module\Asserts::assertInternalType()
  367. */
  368. public function assertInternalType($type, $actual, $description = null) {
  369. return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInternalType', func_get_args()));
  370. }
  371. /**
  372. * [!] Method is generated. Documentation taken from corresponding module.
  373. *
  374. * Fails the test with message.
  375. *
  376. * @param $message
  377. * @see \Codeception\Module\Asserts::fail()
  378. */
  379. public function fail($message) {
  380. return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
  381. }
  382. /**
  383. * [!] Method is generated. Documentation taken from corresponding module.
  384. *
  385. * Handles and checks exception called inside callback function.
  386. * Either exception class name or exception instance should be provided.
  387. *
  388. * ```php
  389. * <?php
  390. * $I->expectException(MyException::class, function() {
  391. * $this->doSomethingBad();
  392. * });
  393. *
  394. * $I->expectException(new MyException(), function() {
  395. * $this->doSomethingBad();
  396. * });
  397. * ```
  398. * If you want to check message or exception code, you can pass them with exception instance:
  399. * ```php
  400. * <?php
  401. * // will check that exception MyException is thrown with "Don't do bad things" message
  402. * $I->expectException(new MyException("Don't do bad things"), function() {
  403. * $this->doSomethingBad();
  404. * });
  405. * ```
  406. *
  407. * @param $exception string or \Exception
  408. * @param $callback
  409. * @see \Codeception\Module\Asserts::expectException()
  410. */
  411. public function expectException($exception, $callback) {
  412. return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
  413. }
  414. }