Use class constant instead of hardcoded namespace

This commit is contained in:
Fabri Di Napoli
2017-03-09 00:14:31 +01:00
parent eb3b8529b6
commit 10ee886fe1
10 changed files with 30 additions and 20 deletions

View File

@@ -3,19 +3,20 @@
namespace DesignPatterns\Structural\Registry\Tests;
use DesignPatterns\Structural\Registry\Registry;
use stdClass;
class RegistryTest extends \PHPUnit_Framework_TestCase
{
public function testSetAndGetLogger()
{
$key = Registry::LOGGER;
$logger = new \stdClass();
$logger = new stdClass();
Registry::set($key, $logger);
$storedLogger = Registry::get($key);
$this->assertSame($logger, $storedLogger);
$this->assertInstanceOf('stdClass', $storedLogger);
$this->assertInstanceOf(stdClass::class, $storedLogger);
}
/**
@@ -23,7 +24,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
*/
public function testThrowsExceptionWhenTryingToSetInvalidKey()
{
Registry::set('foobar', new \stdClass());
Registry::set('foobar', new stdClass());
}
/**