Completed
Pull Request — master (#7)
by Korotkov
02:02
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
/**
4
 * @author  : Jagepard <[email protected]>
5
 * @license https://mit-license.org/ MIT
6
 */
7
8
namespace Fundamental\Delegation\Tests;
9
10
use Fundamental\Delegation\{TeamLead, JuniorDeveloper, MiddleDeveloper};
11
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
12
13
class DelegationTest extends PHPUnit_Framework_TestCase
14
{
15
    /**
16
     * @var TeamLead
17
     */
18
    private $teamLead;
19
20
    protected function setUp(): void
21
    {
22
        $this->teamLead = new TeamLead();
23
    }
24
25
    public function testTeamLead()
26
    {
27
        $this->assertEquals("Some excellent code", $this->teamLead->writeCode());
28
29
        $this->teamLead->delegateTo($this->teamLead);
30
        $this->assertEquals("Some excellent code", $this->teamLead->getCodeFromDeveloper());
31
    }
32
33
    public function testMiddle()
34
    {
35
        $this->teamLead->delegateTo(new MiddleDeveloper());
36
        $this->assertEquals("Some regular code", $this->teamLead->getCodeFromDeveloper());
37
    }
38
39
    public function testJunior()
40
    {
41
        $this->teamLead->delegateTo(new JuniorDeveloper());
42
        $this->assertEquals("Some really bad code", $this->teamLead->getCodeFromDeveloper());
43
    }
44
}
45