create a Test folder for each pattern

This commit is contained in:
Antonio Spinelli
2014-05-05 12:00:18 -03:00
parent 14a9dfe7cf
commit 0c774a89e4
31 changed files with 43 additions and 36 deletions

View 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);
}
}