mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-11 17:34:09 +02:00
it was created the Structural namespace and append its patterns
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Registry;
|
||||
namespace DesignPatterns\Structural\Registry;
|
||||
|
||||
/**
|
||||
* class Registry
|
||||
|
17
Structural/Registry/RegistryTest.php
Normal file
17
Structural/Registry/RegistryTest.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Structural\Registry;
|
||||
|
||||
use DesignPatterns\Structural\Registry\Registry;
|
||||
|
||||
class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testSetAndGetLogger()
|
||||
{
|
||||
Registry::set(Registry::LOGGER, new \StdClass());
|
||||
|
||||
$logger = Registry::get(Registry::LOGGER);
|
||||
$this->assertInstanceOf('StdClass', $logger);
|
||||
}
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
use DesignPatterns\Registry\Registry;
|
||||
|
||||
// while bootstrapping the application
|
||||
Registry::set(Registry::LOGGER, new \StdClass());
|
||||
|
||||
// throughout the application
|
||||
Registry::get(Registry::LOGGER)->log('foo');
|
Reference in New Issue
Block a user