mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-26 06:19:20 +02:00
31 lines
738 B
PHP
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());
|
|
}
|
|
}
|