mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-10 16:04:57 +02:00
26 lines
727 B
PHP
26 lines
727 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Creational\AbstractFactory\Tests;
|
|
|
|
use DesignPatterns\Creational\AbstractFactory\HtmlFactory;
|
|
use DesignPatterns\Creational\AbstractFactory\JsonFactory;
|
|
|
|
class AbstractFactoryTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testCanCreateHtmlText()
|
|
{
|
|
$factory = new HtmlFactory();
|
|
$text = $factory->createText('foobar');
|
|
|
|
$this->assertInstanceOf('DesignPatterns\Creational\AbstractFactory\HtmlText', $text);
|
|
}
|
|
|
|
public function testCanCreateJsonText()
|
|
{
|
|
$factory = new JsonFactory();
|
|
$text = $factory->createText('foobar');
|
|
|
|
$this->assertInstanceOf('DesignPatterns\Creational\AbstractFactory\JsonText', $text);
|
|
}
|
|
}
|