Some more tests, the constant confuses a bit

This commit is contained in:
flobee
2016-02-06 19:58:03 +01:00
parent 4d744833c3
commit 3f1bd03aa4

View File

@@ -6,6 +6,19 @@ use DesignPatterns\Structural\Registry\Registry;
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()
{
Registry::set(Registry::LOGGER, new \StdClass());