mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-27 02:00:20 +02:00
Some more tests, the constant confuses a bit
This commit is contained in:
@@ -6,6 +6,19 @@ use DesignPatterns\Structural\Registry\Registry;
|
|||||||
|
|
||||||
class RegistryTest extends \PHPUnit_Framework_TestCase
|
class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
public function testSimpleGetSet()
|
||||||
|
{
|
||||||
|
$key = 'myIdentifier';
|
||||||
|
$object = new \StdClass();
|
||||||
|
$object->props = array('a' => 1, 'b' => 2);
|
||||||
|
|
||||||
|
Registry::set($key, $object);
|
||||||
|
$actual = Registry::get($key);
|
||||||
|
|
||||||
|
$this->assertEquals($object, $actual);
|
||||||
|
$this->assertInstanceOf('StdClass', $actual);
|
||||||
|
}
|
||||||
|
|
||||||
public function testSetAndGetLogger()
|
public function testSetAndGetLogger()
|
||||||
{
|
{
|
||||||
Registry::set(Registry::LOGGER, new \StdClass());
|
Registry::set(Registry::LOGGER, new \StdClass());
|
||||||
|
Reference in New Issue
Block a user