<?php

namespace Test\FlexiPeeHP;

use FlexiPeeHP\Nastaveni;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2016-04-27 at 17:32:11.
 */
class NastaveniTest extends FlexiBeeROTest
{
    /**
     * @var Nastaveni
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp(): void
    {
        $this->object = new Nastaveni();
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown(): void
    {
        
    }

    /**
     * @covers FlexiPeeHP\Nastaveni::getFlexiData
     */
    public function testGetFlexiData()
    {
        if ($this->object->url == 'https://demo.flexibee.eu') {
            $this->markTestSkipped('Public demo site does not allow read here');
        } else {
            $flexidata = $this->object->getFlexiData();
            $this->assertArrayHasKey(0, $flexidata);
            $this->assertArrayHasKey('id', $flexidata[0]);
            $filtrered = $this->object->getFlexiData(null,
                key($flexidata[0])." = ".current($flexidata[0]));
            $this->assertArrayHasKey(0, $filtrered);
            $this->assertArrayHasKey('id', $filtrered[0]);
        }
    }
}
