mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
create a Test folder for each pattern
This commit is contained in:
30
Creational/StaticFactory/Tests/StaticFactoryTest.php
Normal file
30
Creational/StaticFactory/Tests/StaticFactoryTest.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Creational\StaticFactory\Tests;
|
||||
|
||||
use DesignPatterns\Creational\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\Creational\StaticFactory\FormatterInterface', $obj);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user