instances added god may help
This commit is contained in:
26
tests/Service/Mail/MailServicesFactoryTest.php
Normal file
26
tests/Service/Mail/MailServicesFactoryTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace MintyPHP\Tests\Service\Mail;
|
||||
|
||||
use MintyPHP\Repository\Mail\MailLogRepository;
|
||||
use MintyPHP\Service\Mail\MailLogService;
|
||||
use MintyPHP\Service\Mail\MailService;
|
||||
use MintyPHP\Service\Mail\MailServicesFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MailServicesFactoryTest extends TestCase
|
||||
{
|
||||
public function testFactoryReturnsStableInstancesPerFactoryObject(): void
|
||||
{
|
||||
$factory = new MailServicesFactory();
|
||||
|
||||
$this->assertInstanceOf(MailLogRepository::class, $factory->createMailLogRepository());
|
||||
$this->assertSame($factory->createMailLogRepository(), $factory->createMailLogRepository());
|
||||
|
||||
$this->assertInstanceOf(MailService::class, $factory->createMailService());
|
||||
$this->assertSame($factory->createMailService(), $factory->createMailService());
|
||||
|
||||
$this->assertInstanceOf(MailLogService::class, $factory->createMailLogService());
|
||||
$this->assertSame($factory->createMailLogService(), $factory->createMailLogService());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user