mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
removed ...Interface suffix and added 2nd service to Bridge example
This commit is contained in:
@@ -9,13 +9,17 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class BridgeTest extends TestCase
|
||||
{
|
||||
public function testCanPrintUsingThePlainTextPrinter()
|
||||
public function testCanPrintUsingThePlainTextFormatter()
|
||||
{
|
||||
$service = new HelloWorldService(new PlainTextFormatter());
|
||||
$this->assertSame('Hello World', $service->get());
|
||||
|
||||
// now change the implementation and use the HtmlFormatter instead
|
||||
$service->setImplementation(new HtmlFormatter());
|
||||
$this->assertSame('Hello World', $service->get());
|
||||
}
|
||||
|
||||
public function testCanPrintUsingTheHtmlFormatter()
|
||||
{
|
||||
$service = new HelloWorldService(new HtmlFormatter());
|
||||
|
||||
$this->assertSame('<p>Hello World</p>', $service->get());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user