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

@@ -11,7 +11,7 @@ class MultitonTest extends \PHPUnit_Framework_TestCase
$firstCall = Multiton::getInstance(Multiton::INSTANCE_1);
$secondCall = Multiton::getInstance(Multiton::INSTANCE_1);
$this->assertInstanceOf('DesignPatterns\Creational\Multiton\Multiton', $firstCall);
$this->assertInstanceOf(Multiton::class, $firstCall);
$this->assertSame($firstCall, $secondCall);
}
@@ -20,8 +20,8 @@ class MultitonTest extends \PHPUnit_Framework_TestCase
$firstCall = Multiton::getInstance(Multiton::INSTANCE_1);
$secondCall = Multiton::getInstance(Multiton::INSTANCE_2);
$this->assertInstanceOf('DesignPatterns\Creational\Multiton\Multiton', $firstCall);
$this->assertInstanceOf('DesignPatterns\Creational\Multiton\Multiton', $secondCall);
$this->assertInstanceOf(Multiton::class, $firstCall);
$this->assertInstanceOf(Multiton::class, $secondCall);
$this->assertNotSame($firstCall, $secondCall);
}
}