-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmailSenderTest.php
More file actions
40 lines (34 loc) · 1.16 KB
/
EmailSenderTest.php
File metadata and controls
40 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace Tests\SingleResponsibilityPrinciple;
use PHPUnit\Framework\TestCase;
use SOLID\SingleResponsibilityPrinciple\Email;
use SOLID\SingleResponsibilityPrinciple\EmailSender;
/**
* Class EmailSenderTest.
*
* This class represents a test case for the EmailSender class.
* It tests the Single Responsibility Principle by creating an Email object, setting its properties,
* and sending it using the EmailSender.
*
* @internal
*/
final class EmailSenderTest extends TestCase
{
/**
* Test the Single Responsibility Principle.
*
* This method tests the Single Responsibility Principle by creating an Email object, setting its properties,
* and sending it using the EmailSender.
* It asserts that the actual result of sending the email matches the expected result.
*/
public function testSingleResponsibilityPrinciple(): void
{
$email = new Email();
$email->setRecipient('recipient@example.com');
$email->setSubject('Hello');
$email->setContent('Hello, John!');
$emailSender = new EmailSender();
self::assertTrue($emailSender->SendEmail($email));
}
}