it was created the Structural namespace and append its patterns

This commit is contained in:
Antonio Spinelli
2014-04-15 23:14:39 -03:00
parent 7bf6593e3f
commit 113f63a54f
37 changed files with 77 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
<?php
namespace DesignPatterns\Registry;
namespace DesignPatterns\Structural\Registry;
/**
* class Registry

View 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);
}
}

View File

@@ -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');