Completed
Pull Request — master (#6)
by Korotkov
02:44
created

BuilderTest::getMaster()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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 Creational\Builder\Tests;
11
12
use Creational\Builder\Master;
13
use Creational\Builder\DesktopBuilder;
14
use Creational\Builder\AbstractComputer;
15
use PHPUnit\Framework\TestCase as PHPUnit_Framework_TestCase;
16
17
/**
18
 * Class BuilderTest
19
 * @package Creational\Builder\Tests
20
 */
21
class BuilderTest extends PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @var Master
25
     */
26
    private $master;
27
28
    protected function setUp(): void
29
    {
30
        $this->master = new Master();
31
    }
32
33
    public function testInstance()
34
    {
35
        $this->getMaster()->setBuilder(new DesktopBuilder());
36
        $this->getMaster()->getBuilder()
37
            ->setParam('hdd', 1024)
38
            ->setParam('ram', 8192)
39
            ->setParam('cpu', 3000)
40
            ->setParam('gpu', 5000)
41
            ->setParam('software', 'UNIX');
42
43
        $this->assertInstanceOf(AbstractComputer::class, $this->getMaster()->build());
44
    }
45
46
    /**
47
     * @return Master
48
     */
49
    public function getMaster(): Master
50
    {
51
        return $this->master;
52
    }
53
}
54