FakeFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 8
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A win32Model() 0 6 1
1
<?php
2
3
namespace PhpWinTools\WmiScripting\Testing;
4
5
use PHPUnit\Framework\TestCase;
6
use PhpWinTools\WmiScripting\Configuration\Config;
7
use PhpWinTools\WmiScripting\Testing\Support\Assert;
8
use PhpWinTools\WmiScripting\Testing\Wmi\Win32ModelFactory;
9
use PhpWinTools\WmiScripting\Testing\Responses\ObjectSetResponse;
10
use PhpWinTools\WmiScripting\Testing\Responses\ConnectionResponse;
11
12
class FakeFactory
13
{
14
    protected $testCase;
15
16
    protected $config;
17
18 2
    public function __construct(TestCase $testCase, Config $config = null)
19
    {
20 2
        $this->testCase = $testCase;
21 2
        $this->config = $config ?? Config::testInstance();
22 2
    }
23
24 2
    public function win32Model($class_name, int $count = 1, array $attributes = [])
25
    {
26 2
        ConnectionResponse::standard($this->config);
27 2
        ObjectSetResponse::standard(Win32ModelFactory::make($class_name, $count, $attributes));
28
29 2
        return new Assert($this->testCase);
30
    }
31
}
32