2016-09-23 22:29:25 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace bkrukowski\TransparentEmail\Tests;
|
|
|
|
|
|
|
|
use bkrukowski\TransparentEmail\ServiceCollector;
|
|
|
|
use bkrukowski\TransparentEmail\Services\ServiceInterface;
|
2020-02-13 16:27:05 +03:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2016-09-23 22:29:25 +03:00
|
|
|
|
2020-02-13 16:27:05 +03:00
|
|
|
class ServiceCollectorTest extends TestCase
|
2016-09-23 22:29:25 +03:00
|
|
|
{
|
|
|
|
public function testAddService()
|
|
|
|
{
|
|
|
|
$service = $this->createMock(ServiceInterface::class);
|
|
|
|
$collector = new ServiceCollector();
|
|
|
|
$collector->addService($service);
|
|
|
|
|
|
|
|
$contains = false;
|
|
|
|
foreach ($collector->getIterator() as $currentService) {
|
|
|
|
if ($currentService === $service) {
|
|
|
|
$contains = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->assertTrue($contains);
|
|
|
|
}
|
|
|
|
}
|