mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-08 23:47:11 +02:00
37 lines
983 B
PHP
37 lines
983 B
PHP
<?php
|
|
|
|
namespace DesignPatterns\Behavioral\TemplateMethod\Tests;
|
|
|
|
use DesignPatterns\Behavioral\TemplateMethod;
|
|
|
|
class JourneyTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testCanGetOnVacationOnTheBeach()
|
|
{
|
|
$beachJourney = new TemplateMethod\BeachJourney();
|
|
$beachJourney->takeATrip();
|
|
|
|
$this->assertEquals(
|
|
['Buy a flight ticket', 'Taking the plane', 'Swimming and sun-bathing', 'Taking the plane'],
|
|
$beachJourney->getThingsToDo()
|
|
);
|
|
}
|
|
|
|
public function testCanGetOnAJourneyToACity()
|
|
{
|
|
$beachJourney = new TemplateMethod\CityJourney();
|
|
$beachJourney->takeATrip();
|
|
|
|
$this->assertEquals(
|
|
[
|
|
'Buy a flight ticket',
|
|
'Taking the plane',
|
|
'Eat, drink, take photos and sleep',
|
|
'Buy a gift',
|
|
'Taking the plane'
|
|
],
|
|
$beachJourney->getThingsToDo()
|
|
);
|
|
}
|
|
}
|