mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-29 20:52:52 +02:00
26 lines
719 B
PHP
26 lines
719 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Structural\Bridge\Tests;
|
|
|
|
use DesignPatterns\Structural\Bridge\HelloWorldService;
|
|
use DesignPatterns\Structural\Bridge\HtmlFormatter;
|
|
use DesignPatterns\Structural\Bridge\PlainTextFormatter;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class BridgeTest extends TestCase
|
|
{
|
|
public function testCanPrintUsingThePlainTextFormatter()
|
|
{
|
|
$service = new HelloWorldService(new PlainTextFormatter());
|
|
|
|
$this->assertSame('Hello World', $service->get());
|
|
}
|
|
|
|
public function testCanPrintUsingTheHtmlFormatter()
|
|
{
|
|
$service = new HelloWorldService(new HtmlFormatter());
|
|
|
|
$this->assertSame('<p>Hello World</p>', $service->get());
|
|
}
|
|
}
|