My test code is as follows {code ...} the following error occurs during execution: {code ...} for the code below, refer to the official {code ...} where is my problem? Thank you for your advice. My test code is as follows:
1, 'channel_id' => 2, ]; $this->assertTrue(UserSource::recordUserReg($params)); }}
The following error occurs during execution:
Unit Tests (1) --------------------------------------------------------------------------E UserSourceUintTest: Me -----------------------------------------------------------------------------------------Time: 40 ms, Memory: 6.00MBThere was 1 error:---------1) UserSourceUintTest: Me Test tests/unit/UserSourceUintTest.php:testMe [Error] Class 'app\models\UserSource' not found #1 UserSourceUintTest->testMeERRORS!Tests: 1, Assertions: 0, Errors: 1.
Refer to the official
Classical Unit TestingUnit tests in Codeception are written in absolutely the same way as it is done in PHPUnit:
username = null; $this->assertFalse($user->validate(['username'])); $user->username = 'toolooooongnaaaaaaameeee'; $this->assertFalse($user->validate(['username'])); $user->username = 'davert'; $this->assertTrue($user->validate(['username'])); }}
Where is my problem? Thank you for your advice.
Reply content:
My test code is as follows:
1, 'channel_id' => 2, ]; $this->assertTrue(UserSource::recordUserReg($params)); }}
The following error occurs during execution:
Unit Tests (1) --------------------------------------------------------------------------E UserSourceUintTest: Me -----------------------------------------------------------------------------------------Time: 40 ms, Memory: 6.00MBThere was 1 error:---------1) UserSourceUintTest: Me Test tests/unit/UserSourceUintTest.php:testMe [Error] Class 'app\models\UserSource' not found #1 UserSourceUintTest->testMeERRORS!Tests: 1, Assertions: 0, Errors: 1.
Refer to the official
Classical Unit TestingUnit tests in Codeception are written in absolutely the same way as it is done in PHPUnit:
username = null; $this->assertFalse($user->validate(['username'])); $user->username = 'toolooooongnaaaaaaameeee'; $this->assertFalse($user->validate(['username'])); $user->username = 'davert'; $this->assertTrue($user->validate(['username'])); }}
Where is my problem? Thank you for your advice.