Completed
Pull Request — master (#1)
by Gaël
01:15
created

should_instantiate_facade_with_null_driver()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace DansMaCulotte\Newsletter\Test;
4
5
use DansMaCulotte\Newsletter\Drivers\MailchimpDriver;
6
use DansMaCulotte\Newsletter\Drivers\MailjetDriver;
7
use DansMaCulotte\Newsletter\Drivers\NullDriver;
8
use DansMaCulotte\Newsletter\Newsletter;
9
10
class NewsletterFacadeTest extends TestCase
0 ignored issues
show
Bug introduced by
There is at least one abstract method in this class. Maybe declare it as abstract, or implement the remaining methods: artisan, be, call, seed
Loading history...
11
{
12
    /** @test */
13
    public function should_instantiate_facade_with_null_driver()
14
    {
15
        $newsletter = $this->app[Newsletter::class];
16
        $this->assertInstanceOf(NullDriver::class, $newsletter);
17
    }
18
19
    /** @test */
20 View Code Duplication
    public function should_instantiate_facade_with_mailchimp_driver()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        config()->set('newsletter.driver', 'mailchimp');
23
        config()->set('newsletter.mailchimp.apiKey', 'mailchimp-keytest');
24
25
        $newsletter = $this->app[Newsletter::class];
26
        $this->assertInstanceOf(Newsletter::class, $newsletter);
27
        $this->assertInstanceOf(MailchimpDriver::class, $newsletter->driver);
28
    }
29
30
    /** @test */
31 View Code Duplication
    public function should_instantiate_facade_with_mailjet_driver()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33
        config()->set('newsletter.driver', 'mailjet');
34
        config()->set('newsletter.mailjet.key', 'mailjet-keytest');
35
        config()->set('newsletter.mailjet.secret', 'mailjet-secrettest');
36
37
        $newsletter = $this->app[Newsletter::class];
38
        $this->assertInstanceOf(Newsletter::class, $newsletter);
39
        $this->assertInstanceOf(MailjetDriver::class, $newsletter->driver);
40
    }
41
42
}
43