mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 23:16:33 +02:00
Use class constant instead of hardcoded namespace
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user