mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-06 15:06:31 +02:00
Use class constant instead of hardcoded namespace
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace DesignPatterns\Creational\FactoryMethod\Tests;
|
||||
|
||||
use DesignPatterns\Creational\FactoryMethod\Bicycle;
|
||||
use DesignPatterns\Creational\FactoryMethod\CarFerrari;
|
||||
use DesignPatterns\Creational\FactoryMethod\CarMercedes;
|
||||
use DesignPatterns\Creational\FactoryMethod\FactoryMethod;
|
||||
use DesignPatterns\Creational\FactoryMethod\GermanFactory;
|
||||
use DesignPatterns\Creational\FactoryMethod\ItalianFactory;
|
||||
@@ -13,7 +16,7 @@ class FactoryMethodTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new GermanFactory();
|
||||
$result = $factory->create(FactoryMethod::CHEAP);
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\FactoryMethod\Bicycle', $result);
|
||||
$this->assertInstanceOf(Bicycle::class, $result);
|
||||
}
|
||||
|
||||
public function testCanCreateFastVehicleInGermany()
|
||||
@@ -21,7 +24,7 @@ class FactoryMethodTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new GermanFactory();
|
||||
$result = $factory->create(FactoryMethod::FAST);
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\FactoryMethod\CarMercedes', $result);
|
||||
$this->assertInstanceOf(CarMercedes::class, $result);
|
||||
}
|
||||
|
||||
public function testCanCreateCheapVehicleInItaly()
|
||||
@@ -29,7 +32,7 @@ class FactoryMethodTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new ItalianFactory();
|
||||
$result = $factory->create(FactoryMethod::CHEAP);
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\FactoryMethod\Bicycle', $result);
|
||||
$this->assertInstanceOf(Bicycle::class, $result);
|
||||
}
|
||||
|
||||
public function testCanCreateFastVehicleInItaly()
|
||||
@@ -37,7 +40,7 @@ class FactoryMethodTest extends \PHPUnit_Framework_TestCase
|
||||
$factory = new ItalianFactory();
|
||||
$result = $factory->create(FactoryMethod::FAST);
|
||||
|
||||
$this->assertInstanceOf('DesignPatterns\Creational\FactoryMethod\CarFerrari', $result);
|
||||
$this->assertInstanceOf(CarFerrari::class, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user