mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-12 19:06:24 +02:00
38 lines
989 B
PHP
38 lines
989 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\TemplateMethod\Tests;
|
|
|
|
use DesignPatterns\Behavioral\TemplateMethod;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class JourneyTest extends TestCase
|
|
{
|
|
public function testCanGetOnVacationOnTheBeach()
|
|
{
|
|
$beachJourney = new TemplateMethod\BeachJourney();
|
|
$beachJourney->takeATrip();
|
|
|
|
$this->assertSame(
|
|
['Buy a flight ticket', 'Taking the plane', 'Swimming and sun-bathing', 'Taking the plane'],
|
|
$beachJourney->getThingsToDo()
|
|
);
|
|
}
|
|
|
|
public function testCanGetOnAJourneyToACity()
|
|
{
|
|
$cityJourney = new TemplateMethod\CityJourney();
|
|
$cityJourney->takeATrip();
|
|
|
|
$this->assertSame(
|
|
[
|
|
'Buy a flight ticket',
|
|
'Taking the plane',
|
|
'Eat, drink, take photos and sleep',
|
|
'Buy a gift',
|
|
'Taking the plane'
|
|
],
|
|
$cityJourney->getThingsToDo()
|
|
);
|
|
}
|
|
}
|