Completed
Pull Request — master (#4)
by Korotkov
02:46
created

DelegationTest::getTeamLead()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @license   https://mit-license.org/ MIT
8
 */
9
10
namespace Fundamental\Delegation\Tests;
11
12
use Fundamental\Delegation\TeamLead;
13
use Fundamental\Delegation\JuniorDeveloper;
14
use Fundamental\Delegation\MiddleDeveloper;
15
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
16
17
/**
18
 * Class DelegationTest
19
 * @package Fundamental\Delegation\Tests
20
 */
21
class DelegationTest extends PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @var TeamLead
25
     */
26
    private $teamLead;
27
28
    protected function setUp()
29
    {
30
        $this->teamLead = new TeamLead();
31
    }
32
33
    public function testTeamLead()
34
    {
35
        $this->assertEquals("Some excellent code", $this->getTeamLead()->writeCode());
36
37
        $this->getTeamLead()->delegateTo($this->getTeamLead());
38
        $this->assertEquals("Some excellent code", $this->getTeamLead()->getCodeFromDeveloper());
39
    }
40
41
    public function testMiddle()
42
    {
43
        $this->getTeamLead()->delegateTo(new MiddleDeveloper());
44
        $this->assertEquals("Some regular code", $this->getTeamLead()->getCodeFromDeveloper());
45
    }
46
47
    public function testJunior()
48
    {
49
        $this->getTeamLead()->delegateTo(new JuniorDeveloper());
50
        $this->assertEquals("Some really bad code", $this->getTeamLead()->getCodeFromDeveloper());
51
    }
52
53
    /**
54
     * @return TeamLead
55
     */
56
    public function getTeamLead(): TeamLead
57
    {
58
        return $this->teamLead;
59
    }
60
}
61