mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 12:10:10 +02:00
merge from master
This commit is contained in:
@@ -26,22 +26,15 @@ class ServiceLocatorTest extends TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->serviceLocator = new ServiceLocator();
|
||||
|
||||
$this->logService = new LogService();
|
||||
$this->serviceLocator = new ServiceLocator();
|
||||
$this->logService = new LogService();
|
||||
$this->databaseService = new DatabaseService();
|
||||
}
|
||||
|
||||
public function testHasServices()
|
||||
{
|
||||
$this->serviceLocator->add(
|
||||
'DesignPatterns\More\ServiceLocator\LogServiceInterface',
|
||||
$this->logService
|
||||
);
|
||||
$this->serviceLocator->add(
|
||||
'DesignPatterns\More\ServiceLocator\DatabaseServiceInterface',
|
||||
$this->databaseService
|
||||
);
|
||||
$this->serviceLocator->add('DesignPatterns\More\ServiceLocator\LogServiceInterface', $this->logService);
|
||||
$this->serviceLocator->add('DesignPatterns\More\ServiceLocator\DatabaseServiceInterface', $this->databaseService);
|
||||
|
||||
$this->assertTrue($this->serviceLocator->has('DesignPatterns\More\ServiceLocator\LogServiceInterface'));
|
||||
$this->assertTrue($this->serviceLocator->has('DesignPatterns\More\ServiceLocator\DatabaseServiceInterface'));
|
||||
|
Reference in New Issue
Block a user