Code Duplication    Length = 17-19 lines in 2 locations

tests/MailChimp/NewsletterTest.php 2 locations

@@ 47-63 (lines=17) @@
44
    }
45
46
    /** @test */
47
    public function it_can_subscribe_someone()
48
    {
49
        $email = '[email protected]';
50
51
        $url = 'lists/123/members';
52
53
        $this->mailChimpApi->shouldReceive('post')->withArgs([
54
            $url,
55
            [
56
                'email_address' => $email,
57
                'status' => 'subscribed',
58
                'email_type' => 'html',
59
            ],
60
        ]);
61
62
        $this->newsletter->subscribe($email);
63
    }
64
65
    /** @test */
66
    public function it_can_subscribe_someone_with_merge_fields()
@@ 90-108 (lines=19) @@
87
    }
88
89
    /** @test */
90
    public function it_can_subscribe_someone_to_an_alternative_list()
91
    {
92
        $email = '[email protected]';
93
94
        $url = 'lists/456/members';
95
96
        $this->mailChimpApi->shouldReceive('post')
97
            ->once()
98
            ->withArgs([
99
                $url,
100
                [
101
                    'email_address' => $email,
102
                    'status' => 'subscribed',
103
                    'email_type' => 'html',
104
                ],
105
            ]);
106
107
        $this->newsletter->subscribe($email, [], 'list2');
108
    }
109
110
    /** @test */
111
    public function it_can_override_the_defaults_when_subscribing_someone()