mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-07 23:46:52 +02:00
Use class constant instead of hardcoded namespace
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace DesignPatterns\Creational\AbstractFactory\Tests;
|
||||
|
||||
use DesignPatterns\Creational\AbstractFactory\HtmlFactory;
|
||||
use DesignPatterns\Creational\AbstractFactory\HtmlText;
|
||||
use DesignPatterns\Creational\AbstractFactory\JsonFactory;
|
||||
use DesignPatterns\Creational\AbstractFactory\JsonText;
|
||||
|
||||
class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@@ -12,7 +14,7 @@ class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new HtmlFactory();
|
||||
$text = $factory->createText('foobar');
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\AbstractFactory\HtmlText', $text);
|
||||
$this->assertInstanceOf(HtmlText::class, $text);
|
||||
}
|
||||
|
||||
public function testCanCreateJsonText()
|
||||
@@ -20,6 +22,6 @@ class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new JsonFactory();
|
||||
$text = $factory->createText('foobar');
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\AbstractFactory\JsonText', $text);
|
||||
$this->assertInstanceOf(JsonText::class, $text);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user