mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-10 01:46:22 +02:00
28 lines
720 B
PHP
28 lines
720 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());
|
|
}
|
|
}
|