mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-03 05:27:29 +02:00
refactored Registry test: merged SimpleGetSet and SetAndGetLogger into one
This commit is contained in:
@@ -6,11 +6,10 @@ use DesignPatterns\Structural\Registry\Registry;
|
|||||||
|
|
||||||
class RegistryTest extends \PHPUnit_Framework_TestCase
|
class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testSimpleGetSet()
|
public function testSetAndGetLogger()
|
||||||
{
|
{
|
||||||
$key = 'myIdentifier';
|
$key = Registry::LOGGER;
|
||||||
$object = new \StdClass();
|
$object = new \StdClass();
|
||||||
$object->props = array('a' => 1, 'b' => 2);
|
|
||||||
|
|
||||||
Registry::set($key, $object);
|
Registry::set($key, $object);
|
||||||
$actual = Registry::get($key);
|
$actual = Registry::get($key);
|
||||||
@@ -18,12 +17,4 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->assertEquals($object, $actual);
|
$this->assertEquals($object, $actual);
|
||||||
$this->assertInstanceOf('StdClass', $actual);
|
$this->assertInstanceOf('StdClass', $actual);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSetAndGetLogger()
|
|
||||||
{
|
|
||||||
Registry::set(Registry::LOGGER, new \StdClass());
|
|
||||||
|
|
||||||
$logger = Registry::get(Registry::LOGGER);
|
|
||||||
$this->assertInstanceOf('StdClass', $logger);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user