Code Duplication    Length = 7-8 lines in 2 locations

tests/codeception/unit/UserTest.php 2 locations

@@ 98-105 (lines=8) @@
95
            expect("we can create user with autogenerated password", $user->create())->true();
96
        });
97
98
        $this->specify("we have create user without name", function () {
99
            $user = new User([
100
                'email' => '[email protected]',
101
                'password' => 'password',
102
            ]);
103
            expect("we can't create user without name", $user->create())->false();
104
            expect("we can see error `name`", $user->getErrors())->hasKey('name');
105
        });
106
    }
107
108
    /**
@@ 203-209 (lines=7) @@
200
            $user->register();
201
        }, ['throws' => new \RuntimeException]);
202
203
        $this->specify("we have register user with same email", function () {
204
            $user = new User([
205
                'email' => '[email protected]',
206
            ]);
207
            expect("we can't create user with same email", $user->register())->false();
208
            expect("we must see error message", $user->getErrors())->hasKey('email');
209
        });
210
211
        $this->module->registrationFields = ['password'];
212
        $this->specify("we have register user by email with password", function () {