Code Duplication    Length = 8-10 lines in 4 locations

tests/SmsManagerTest.php 4 locations

@@ 45-54 (lines=10) @@
42
        $this->assertInstanceOf(Driver::class, $manager->driverInstance());
43
    }
44
45
    public function test_can_call_directly()
46
    {
47
        $response = (new MockSmsManager())->via('bar')
48
            ->send('foo', function ($message) {
49
                $message->to(['baz']);
50
            });
51
        $this->assertInstanceOf(BarDriver::class, $response);
52
        $this->assertEquals('foo', $response->getBody());
53
        $this->assertContains('baz', $response->getRecipients());
54
    }
55
56
    public function test_can_call_from_facade()
57
    {
@@ 56-65 (lines=10) @@
53
        $this->assertContains('baz', $response->getRecipients());
54
    }
55
56
    public function test_can_call_from_facade()
57
    {
58
        $response = Sms::via('bar')->send('foo', function ($m) {
59
            $m->to('baz');
60
        });
61
62
        $this->assertInstanceOf(BarDriver::class, $response);
63
        $this->assertEquals('foo', $response->getBody());
64
        $this->assertContains('baz', $response->getRecipients());
65
    }
66
67
    public function test_can_be_sent_by_dispatch_method()
68
    {
@@ 67-74 (lines=8) @@
64
        $this->assertContains('baz', $response->getRecipients());
65
    }
66
67
    public function test_can_be_sent_by_dispatch_method()
68
    {
69
        $response = Sms::via('bar')->send('foo')->to('baz')->dispatch();
70
71
        $this->assertInstanceOf(BarDriver::class, $response);
72
        $this->assertEquals('foo', $response->getBody());
73
        $this->assertContains('baz', $response->getRecipients());
74
    }
75
76
    public function test_sms_builder_can_be_sent()
77
    {
@@ 76-83 (lines=8) @@
73
        $this->assertContains('baz', $response->getRecipients());
74
    }
75
76
    public function test_sms_builder_can_be_sent()
77
    {
78
        $response = Sms::send((new SmsBuilder)->via('bar')->to('baz')->send('foo'));
79
80
        $this->assertInstanceOf(BarDriver::class, $response);
81
        $this->assertEquals('foo', $response->getBody());
82
        $this->assertContains('baz', $response->getRecipients());
83
    }
84
85
    public function test_sms_builder_via_can_be_sent(Type $var = null)
86
    {