1
- <?php //[STAMP] 5648e2ecd2668319703f108f1329e8a8
1
+ <?php //[STAMP] 5e4c7302c0b63a4df799dc88da465f39
2
2
namespace _generated ;
3
3
4
4
// This class was automatically generated by build task
5
5
// You should not change it manually as it will be overwritten on next build
6
6
// @codingStandardsIgnoreFile
7
7
8
- use Codeception \Module \Asserts ;
9
- use Helper \Unit ;
10
-
11
8
trait UnitTesterActions
12
9
{
13
10
/**
@@ -26,13 +23,13 @@ abstract protected function getScenario();
26
23
* Regular example:
27
24
* ```php
28
25
* <?php
29
- * $I->assertEquals($element->getChildrenCount(), 5 );
26
+ * $I->assertEquals(5, $element->getChildrenCount());
30
27
* ```
31
28
*
32
29
* Floating-point example:
33
30
* ```php
34
31
* <?php
35
- * $I->assertEquals($calculator->add(0.1, 0.2), 0.3 , 'Calculator should add the two numbers correctly.', 0.01);
32
+ * $I->assertEquals(0.3, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
36
33
* ```
37
34
*
38
35
* @param $expected
@@ -56,13 +53,13 @@ public function assertEquals($expected, $actual, $message = null, $delta = null)
56
53
* Regular example:
57
54
* ```php
58
55
* <?php
59
- * $I->assertNotEquals($element->getChildrenCount(), 0 );
56
+ * $I->assertNotEquals(0, $element->getChildrenCount());
60
57
* ```
61
58
*
62
59
* Floating-point example:
63
60
* ```php
64
61
* <?php
65
- * $I->assertNotEquals($calculator->add(0.1, 0.2), 0.4 , 'Calculator should add the two numbers correctly.', 0.01);
62
+ * $I->assertNotEquals(0.4, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
66
63
* ```
67
64
*
68
65
* @param $expected
@@ -326,6 +323,20 @@ public function assertTrue($condition, $message = null) {
326
323
}
327
324
328
325
326
+ /**
327
+ * [!] Method is generated. Documentation taken from corresponding module.
328
+ *
329
+ * Checks that the condition is NOT true (everything but true)
330
+ *
331
+ * @param $condition
332
+ * @param string $message
333
+ * @see \Codeception\Module\Asserts::assertNotTrue()
334
+ */
335
+ public function assertNotTrue ($ condition , $ message = null ) {
336
+ return $ this ->getScenario ()->runStep (new \Codeception \Step \Action ('assertNotTrue ' , func_get_args ()));
337
+ }
338
+
339
+
329
340
/**
330
341
* [!] Method is generated. Documentation taken from corresponding module.
331
342
*
@@ -340,6 +351,20 @@ public function assertFalse($condition, $message = null) {
340
351
}
341
352
342
353
354
+ /**
355
+ * [!] Method is generated. Documentation taken from corresponding module.
356
+ *
357
+ * Checks that the condition is NOT false (everything but false)
358
+ *
359
+ * @param $condition
360
+ * @param string $message
361
+ * @see \Codeception\Module\Asserts::assertNotFalse()
362
+ */
363
+ public function assertNotFalse ($ condition , $ message = null ) {
364
+ return $ this ->getScenario ()->runStep (new \Codeception \Step \Action ('assertNotFalse ' , func_get_args ()));
365
+ }
366
+
367
+
343
368
/**
344
369
* [!] Method is generated. Documentation taken from corresponding module.
345
370
*
@@ -540,9 +565,45 @@ public function fail($message) {
540
565
*
541
566
* @param $exception string or \Exception
542
567
* @param $callback
568
+ *
569
+ * @deprecated Use expectThrowable instead
543
570
* @see \Codeception\Module\Asserts::expectException()
544
571
*/
545
572
public function expectException ($ exception , $ callback ) {
546
573
return $ this ->getScenario ()->runStep (new \Codeception \Step \Action ('expectException ' , func_get_args ()));
547
574
}
575
+
576
+
577
+ /**
578
+ * [!] Method is generated. Documentation taken from corresponding module.
579
+ *
580
+ * Handles and checks throwables (Exceptions/Errors) called inside the callback function.
581
+ * Either throwable class name or throwable instance should be provided.
582
+ *
583
+ * ```php
584
+ * <?php
585
+ * $I->expectThrowable(MyThrowable::class, function() {
586
+ * $this->doSomethingBad();
587
+ * });
588
+ *
589
+ * $I->expectThrowable(new MyException(), function() {
590
+ * $this->doSomethingBad();
591
+ * });
592
+ * ```
593
+ * If you want to check message or throwable code, you can pass them with throwable instance:
594
+ * ```php
595
+ * <?php
596
+ * // will check that throwable MyError is thrown with "Don't do bad things" message
597
+ * $I->expectThrowable(new MyError("Don't do bad things"), function() {
598
+ * $this->doSomethingBad();
599
+ * });
600
+ * ```
601
+ *
602
+ * @param $throwable string or \Throwable
603
+ * @param $callback
604
+ * @see \Codeception\Module\Asserts::expectThrowable()
605
+ */
606
+ public function expectThrowable ($ throwable , $ callback ) {
607
+ return $ this ->getScenario ()->runStep (new \Codeception \Step \Action ('expectThrowable ' , func_get_args ()));
608
+ }
548
609
}
0 commit comments