Code Duplication    Length = 17-18 lines in 3 locations

tests/TestUser.php 3 locations

@@ 112-129 (lines=18) @@
109
    *  Testing for the login with invalid or wrong email
110
    */
111
112
    public function test_authLoginWrongEmail()
113
    {
114
        $output = $this->obLogin->authLogin(
115
            [
116
                "login" => '[email protected]',
117
                "passLogin" => 'egfb'
118
            ]
119
        );
120
        $output = (array)json_decode($output, True);
121
        $expectedOutput = [
122
            [
123
                "key" => "login",
124
                "value" => " *Enter correct Email address"
125
            ]
126
        ];
127
128
        $this->assertEquals($expectedOutput, $output);
129
    }
130
131
    /**
132
    * @depends test_authRegister
@@ 135-152 (lines=18) @@
132
    * @depends test_authRegister
133
    *  Testing for the login with invalid email credentials
134
    */
135
    public function test_authLoginInvalidUsernameEmail()
136
    {
137
        $output = $this->obLogin->authLogin(
138
            [
139
                "login" => 'invalid',
140
                "passLogin" => 'invalid'
141
            ]
142
        );
143
        $output = (array)json_decode($output, True);
144
        $expectedOutput = [
145
            [
146
                "key" => "login",
147
                "value" => " *Invalid username or email"
148
            ]
149
        ];
150
151
        $this->assertEquals($expectedOutput, $output);
152
    }
153
154
    /**
155
    * @depends test_authRegister
@@ 158-174 (lines=17) @@
155
    * @depends test_authRegister
156
    *  Testing for the login with invalid password credentials
157
    */
158
    public function test_authLoginInvalidPassword()
159
    {
160
        $output = $this->obLogin->authLogin(
161
            [
162
                "login" => 'test',
163
                "passLogin" => 'invalid'
164
            ]
165
        );
166
        $output = (array)json_decode($output, True);
167
        $expectedOutput = [
168
            [
169
                "key" => "passLogin",
170
                "value" => " *Invalid password"
171
            ]
172
        ];
173
        $this->assertEquals($expectedOutput, $output);
174
    }
175
176
    /**
177
    * @depends test_authRegister