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