Files
DesignPatternsPHP/More/Delegation/Tests/DelegationTest.php
2018-04-29 15:55:54 +02:00

31 lines
738 B
PHP

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