mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-06 14:04:55 +02:00
test for static factory
This commit is contained in:
parent
2bea1f390f
commit
87d4c9277d
31
Tests/StaticFactory/StaticFactoryTest.php
Normal file
31
Tests/StaticFactory/StaticFactoryTest.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace DesignPatterns\Tests\StaticFactory;
|
||||||
|
|
||||||
|
use DesignPatterns\StaticFactory\StaticFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for Static Factory pattern
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class StaticFactoryTest extends \PHPUnit_Framework_TestCase
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('string'),
|
||||||
|
array('number')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider getTypeList
|
||||||
|
*/
|
||||||
|
public function testCreation($type)
|
||||||
|
{
|
||||||
|
$obj = StaticFactory::factory($type);
|
||||||
|
$this->assertInstanceOf('DesignPatterns\StaticFactory\Formatter', $obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user