<?php

namespace KupShop\KupShopBundle\Tests;

use KupShop\KupShopBundle\Config;
use KupShop\KupShopBundle\Context\DomainContext;

class ContextTest extends \DatabaseTestCase
{
    public function testDomainContextInConfig()
    {
        $context = $this->get(DomainContext::class);
        $this->assertEquals('www.kupshop.local', $context->getActiveId());

        $context->activate('www.czdomena.cz');
        $this->assertEquals('www.czdomena.cz', $context->getActiveId());
        $this->assertEquals([
            'print' => 'www.czdomena.cz/',
            'full' => 'https://www.czdomena.cz/',
            'rel' => '/',
            'print_original' => 'www.kosmetika-zdravi.kupshop.cz/',
            'full_original' => 'http://www.kosmetika-zdravi.kupshop.cz/',
        ], Config::get()['Addr']);
    }
}
