Code Duplication    Length = 37-37 lines in 2 locations

app/Containers/Stripe/Tests/Api/Functional/CreateStripeAccountTest.php 1 location

@@ 12-48 (lines=37) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreateStripeAccountTest extends TestCase
13
{
14
15
    private $endpoint = '/stripes';
16
17
    public function testCreateStripeAccount()
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
            'customer_id'      => 'cus_123456789',
29
            'card_id'          => 'car_123456789',
30
            'card_funding'     => 'qwerty',
31
            'card_last_digits' => '1234',
32
            'card_fingerprint' => 'zxcvbn',
33
        ];
34
35
        // send the HTTP request
36
        $response = $this->apiCall($this->endpoint, 'post', $data, true);
37
38
        // assert response status is correct
39
        $this->assertEquals($response->getStatusCode(), '202');
40
41
        // convert JSON response string to Array
42
        $responseArray = json_decode($response->getContent());
43
44
        $this->assertEquals($responseArray->message, 'Stripe account created successfully.');
45
46
    }
47
48
}
49

app/Containers/Stripe/UI/API/Tests/Functional/CreateStripeAccountTest.php 1 location

@@ 12-48 (lines=37) @@
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreateStripeAccountTest extends TestCase
13
{
14
15
    private $endpoint = '/stripes';
16
17
    public function testCreateStripeAccount()
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
            'customer_id'      => 'cus_123456789',
29
            'card_id'          => 'car_123456789',
30
            'card_funding'     => 'qwerty',
31
            'card_last_digits' => '1234',
32
            'card_fingerprint' => 'zxcvbn',
33
        ];
34
35
        // send the HTTP request
36
        $response = $this->apiCall($this->endpoint, 'post', $data, true);
37
38
        // assert response status is correct
39
        $this->assertEquals($response->getStatusCode(), '202');
40
41
        // convert JSON response string to Array
42
        $responseArray = json_decode($response->getContent());
43
44
        $this->assertEquals($responseArray->message, 'Stripe account created successfully.');
45
46
    }
47
48
}
49