Completed
Push — master ( ea522c...375169 )
by Korotkov
04:17
created

BuilderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testInstance() 0 10 1
A setUp() 0 3 1
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
    /**
25
     * @var Master
26
     */
27
    protected $master;
28
29
    protected function setUp(): void
30
    {
31
        $this->master = new Master(new DesktopBuilder());
32
    }
33
34
    public function testInstance()
35
    {
36
        $this->master->getBuilder()
37
            ->addParam('hdd', 1024)
38
            ->addParam('ram', 8192)
39
            ->addParam('cpu', 3000)
40
            ->addParam('gpu', 5000)
41
            ->addParam('software', 'UNIX');
42
43
        $this->assertInstanceOf(AbstractComputer::class, $this->master->build());
44
    }
45
}
46