コード例 #1
0
 public function testCanCreateHtmlText()
 {
     $factory = new HtmlFactory();
     $text = $factory->createText('foobar');
     $this->assertInstanceOf('DesignPatterns\\Creational\\AbstractFactory\\HtmlText', $text);
 }
コード例 #2
0
 public function testRenderText()
 {
     $type = 'text';
     $media = HtmlFactory::getInstance($type);
     $this->assertEquals($type, $media->render());
 }
コード例 #3
0
ファイル: exe.php プロジェクト: hackingangle/design-patterns
<?php

require './vendor/autoload.php';
use DesignPatterns\Creational\AbstractFactory\HtmlFactory;
$mediaType = 'text';
$media = HtmlFactory::getInstance($mediaType);
$media->render();