mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	#148: remove depreacted error.password_required
This commit is contained in:
		@@ -6,6 +6,7 @@ use Codeception\Specify;
 | 
			
		||||
use common\models\Account;
 | 
			
		||||
use tests\codeception\api\unit\DbTestCase;
 | 
			
		||||
use tests\codeception\common\_support\ProtectedCaller;
 | 
			
		||||
use common\helpers\Error as E;
 | 
			
		||||
 | 
			
		||||
class PasswordRequiredValidatorTest extends DbTestCase {
 | 
			
		||||
    use Specify;
 | 
			
		||||
@@ -15,12 +16,12 @@ class PasswordRequiredValidatorTest extends DbTestCase {
 | 
			
		||||
        $account = new Account(['password' => '12345678']);
 | 
			
		||||
        $this->specify('get error.password_required if password is empty', function () use ($account) {
 | 
			
		||||
            $model = new PasswordRequiredValidator(['account' => $account]);
 | 
			
		||||
            expect($this->callProtected($model, 'validateValue', ''))->equals(['error.password_required', []]);
 | 
			
		||||
            expect($this->callProtected($model, 'validateValue', ''))->equals([E::PASSWORD_REQUIRED, []]);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        $this->specify('get error.password_invalid if password is incorrect', function () use ($account) {
 | 
			
		||||
        $this->specify('get error.password_incorrect if password is incorrect', function () use ($account) {
 | 
			
		||||
            $model = new PasswordRequiredValidator(['account' => $account]);
 | 
			
		||||
            expect($this->callProtected($model, 'validateValue', '87654321'))->equals(['error.password_invalid', []]);
 | 
			
		||||
            expect($this->callProtected($model, 'validateValue', '87654321'))->equals([E::PASSWORD_INCORRECT, []]);
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        $this->specify('no errors, if password is correct for provided account', function () use ($account) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user