Completed
Push — master ( 8d9cf8...669f46 )
by Vítězslav
04:09
created

NastaveniTest::testGetFlexiData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 11

Duplication

Lines 9
Ratio 64.29 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 11
c 1
b 0
f 1
nc 2
nop 0
dl 9
loc 14
rs 9.4285
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 FlexiBeeTest
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()
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()
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');
42 View Code Duplication
        } else {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
43
            $flexidata = $this->object->getFlexiData();
44
            $this->assertArrayHasKey(0, $flexidata);
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
}