NastaveniTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 13
dl 0
loc 40
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 3 1
A tearDown() 0 2 1
A testGetFlexiData() 0 12 2
1
<?php
2
3
namespace Test\FlexiPeeHP;
4
5
use FlexiPeeHP\Nastaveni;
6
7
/**
8
 * Generated by PHPUnit_SkeletonGenerator on 2016-04-27 at 17:32:11.
9
 */
10
class NastaveniTest extends FlexiBeeROTest
11
{
12
    /**
13
     * @var Nastaveni
14
     */
15
    protected $object;
16
17
    /**
18
     * Sets up the fixture, for example, opens a network connection.
19
     * This method is called before a test is executed.
20
     */
21
    protected function setUp(): void
22
    {
23
        $this->object = new Nastaveni();
24
    }
25
26
    /**
27
     * Tears down the fixture, for example, closes a network connection.
28
     * This method is called after a test is executed.
29
     */
30
    protected function tearDown(): void
31
    {
32
        
33
    }
34
35
    /**
36
     * @covers FlexiPeeHP\Nastaveni::getFlexiData
37
     */
38
    public function testGetFlexiData()
39
    {
40
        if ($this->object->url == 'https://demo.flexibee.eu') {
41
            $this->markTestSkipped('Public demo site does not allow read here');
0 ignored issues
show
Bug introduced by
The method markTestSkipped() does not exist on Test\FlexiPeeHP\NastaveniTest. Did you maybe mean markTestSuiteSkipped()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

41
            $this->/** @scrutinizer ignore-call */ 
42
                   markTestSkipped('Public demo site does not allow read here');

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
42
        } else {
43
            $flexidata = $this->object->getFlexiData();
44
            $this->assertArrayHasKey(0, $flexidata);
0 ignored issues
show
Bug introduced by
The method assertArrayHasKey() does not exist on Test\FlexiPeeHP\NastaveniTest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

44
            $this->/** @scrutinizer ignore-call */ 
45
                   assertArrayHasKey(0, $flexidata);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
            $this->assertArrayHasKey('id', $flexidata[0]);
46
            $filtrered = $this->object->getFlexiData(null,
47
                key($flexidata[0])." = ".current($flexidata[0]));
48
            $this->assertArrayHasKey(0, $filtrered);
49
            $this->assertArrayHasKey('id', $filtrered[0]);
50
        }
51
    }
52
}
53