@@ -16,6 +16,7 @@
|
16 | 16 | use Codeception\Lib\Interfaces\MultiSession; |
17 | 17 | use Codeception\Lib\Interfaces\PartedModule; |
18 | 18 | use Codeception\TestInterface; |
| 19 | +use PHPUnit\Framework\Assert; |
19 | 20 | use ReflectionClass; |
20 | 21 | use RuntimeException; |
21 | 22 | use Symfony\Component\BrowserKit\CookieJar; |
@@ -647,7 +648,7 @@ public function haveRecord(string $model, $attributes = []): int|string|array
|
647 | 648 | $record = \Yii::createObject($model); |
648 | 649 | $record->setAttributes($attributes, false); |
649 | 650 | if (! $record->save(false)) { |
650 | | -$this->fail("Record $model was not saved: " . \yii\helpers\Json::encode($record->errors)); |
| 651 | +Assert::fail("Record $model was not saved: " . \yii\helpers\Json::encode($record->errors)); |
651 | 652 | } |
652 | 653 | return $record->getPrimaryKey(); |
653 | 654 | } |
@@ -667,7 +668,7 @@ public function seeRecord(string $model, array $attributes = []): void
|
667 | 668 | { |
668 | 669 | $record = $this->findRecord($model, $attributes); |
669 | 670 | if (! $record) { |
670 | | -$this->fail("Couldn't find $model with " . json_encode($attributes)); |
| 671 | +Assert::fail("Couldn't find $model with " . json_encode($attributes)); |
671 | 672 | } |
672 | 673 | $this->debugSection($model, json_encode($record)); |
673 | 674 | } |
@@ -688,7 +689,7 @@ public function dontSeeRecord(string $model, array $attributes = []): void
|
688 | 689 | $record = $this->findRecord($model, $attributes); |
689 | 690 | $this->debugSection($model, json_encode($record)); |
690 | 691 | if ($record) { |
691 | | -$this->fail("Unexpectedly managed to find $model with " . json_encode($attributes)); |
| 692 | +Assert::fail("Unexpectedly managed to find $model with " . json_encode($attributes)); |
692 | 693 | } |
693 | 694 | } |
694 | 695 | |
|