Passed
Push — master ( f71dbb...d070fe )
by Radosław
02:35
created

FactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A providerFactoryClass() 0 7 1
A testFactoryReturnsHelper() 0 16 1
1
<?php
2
3
namespace Radowoj\Yaah\HelperFactory;
4
5
use PHPUnit\Framework\TestCase;
6
use Radowoj\Yaah\Auction;
7
8
class FactoryTest extends TestCase
9
{
10
11
    public function providerFactoryClass()
12
    {
13
        return [
14
            ['Factory'],
15
            ['DebugFactory'],
16
        ];
17
    }
18
19
    /**
20
     * @dataProvider providerFactoryClass
21
     */
22
    public function testFactoryReturnsHelper($factoryClass)
23
    {
24
        $class = "Radowoj\\Yaah\\HelperFactory\\{$factoryClass}";
25
26
        $factory = new $class();
27
28
        $helper = $factory->create([
29
            'apiKey' => 'some-api-key',
30
            'login' => 'some-login',
31
            'passwordHash' => 'some-password-hash',
32
            'isSandbox' => true,
33
            'countryCode' => 1,
34
        ]);
35
36
        $this->assertInstanceOf('Radowoj\Yaah\Helper', $helper);
37
    }
38
}
39