Test Failed
Branch main (0ffd95)
by
unknown
01:57
created

SendTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 4
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A send_an_email() 0 19 1
1
<?php
2
3
namespace Tests\Integration\Email;
4
5
use ElasticEmail\ElasticEmail;
6
use Tests\Integration\IntegrationTestCase;
7
8
class SendTest extends IntegrationTestCase
9
{
10
    /** @test */
11
    public function send_an_email()
12
    {
13
        $this->loadEnv();
14
        $subject = "elasticemail-php: Integration test ensuring email send.";
15
16
        $elasticEmail = new ElasticEmail($_ENV['ELASTIC_EMAIL_API_KEY']);
17
        $response = $elasticEmail->email()->send([
18
            'to' => $_ENV['TEST_EMAIL_TO'],
19
            'from' => $_ENV['TEST_EMAIL_FROM'],
20
            'subject' => $subject,
21
            'bodyText' => 'Your mind will answer most questions if you learn '
22
                . 'to relax and wait for the answer.'
23
        ]);
24
25
        $this->assertTrue($response->wasSuccessful());
26
        $this->assertEquals(200, $response->getStatusCode());
27
28
        d($response->getBody());
29
    }
30
}
31