Code Duplication    Length = 27-33 lines in 2 locations

app/Containers/Email/UI/API/Tests/Functional/SetVisitorEmailTest.php 1 location

@@ 13-39 (lines=27) @@
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class SetVisitorEmailTest extends TestCase
14
{
15
16
    private $endpoint = '/visitors/email';
17
18
    public function testSetVisitorEmail_()
19
    {
20
        $data = [
21
            'email' => '[email protected]',
22
        ];
23
24
        $visitor = $this->getVisitor();
25
26
        $headers['visitor-id'] = $visitor->visitor_id;
27
28
        // send the HTTP request
29
        $response = $this->apiCall($this->endpoint, 'post', $data, false, $headers);
30
31
        // assert response status is correct
32
        $this->assertEquals($response->getStatusCode(), '202');
33
34
        $this->assertResponseContainKeyValue(['message' => 'Visitor Email Saved Successfully.'], $response);
35
36
        $this->seeInDatabase('users', ['email' => $data['email']]);
37
    }
38
39
}
40

app/Containers/Paypal/UI/API/Tests/Functional/CreatePaypalAccountTest.php 1 location

@@ 12-44 (lines=33) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreatePaypalAccountTest extends TestCase
13
{
14
15
    private $endpoint = '/paypals';
16
17
    public function testCreatePaypalAccount()
18
    {
19
        $userDetails = [
20
            'name' => 'Mahmoud Zalt',
21
            'email' => '[email protected]',
22
            'password' => 'passssssssssss',
23
        ];
24
        // get the logged in user (create one if no one is logged in)
25
        $user = $this->registerAndLoginTestingUser($userDetails);
26
27
        $data = [
28
           // TODO: To Be Continue...
29
        ];
30
31
        // send the HTTP request
32
        $response = $this->apiCall($this->endpoint, 'post', $data, true);
33
34
        // assert response status is correct
35
        $this->assertEquals($response->getStatusCode(), '202');
36
37
        // convert JSON response string to Object
38
        $responseObject = $this->getResponseObject($response);
39
40
        $this->assertEquals($responseObject->message, 'Paypal account created successfully.');
41
42
    }
43
44
}
45