Files
DesignPatternsPHP/More/Delegation/Tests/DelegationTest.php
2018-05-13 19:19:53 +02:00

26 lines
689 B
PHP

<?php
namespace DesignPatterns\More\Delegation\Tests;
use DesignPatterns\More\Delegation;
use PHPUnit\Framework\TestCase;
class DelegationTest extends TestCase
{
public function testTeamLeadCanBlameJuniorForBadCode()
{
$junior = new Delegation\JuniorDeveloper();
$teamLead = new Delegation\TeamLead($junior);
$this->assertEquals($junior->writeBadCode(), $teamLead->writeCode());
}
public function testTeamLeadCanWriteBadCode()
{
$junior = new Delegation\JuniorDeveloper();
$teamLead = new Delegation\TeamLead($junior);
$this->assertEquals($junior->writeReallyBadCode($teamLead), $teamLead->writeBadCode());
}
}