<?php

Designer::load('Designer_App_Project');
Designer::load('Designer_Tests_TestCase');

class Designer_Tests_ProjectTest extends Designer_Tests_TestCase
{
    public function saveAndGetProjectData()
    {
        Project::$projectFile = realpath(dirname(__FILE__)) . '/assets/project.json';

        $expected = new stdClass();
        $expected->themeId = 'nD0h1TCThIPCtb8LJ0oUKA==';
        $expected->project = '\"constructorName\":\"Theme\",\"packageData\":{\"id\":\"1629469\",\"name\":\"Theme\"},\"id\":1,\"dataId\":1090,\"css\":{\"typography\":{\"TypographyTextLinkPassive\":{\"color\":\"@bd-link-color\"},\"TypographyTextLinkHovered\":{\"color\":\"@bd-link-color-hover\",\"text-decoration\":\"underline\"}}}}"';

        Project::saveProperty('projectdata', $expected);
        $actual = Project::getProperty('projectdata');

        $this->assertSoftEquals($expected, $actual);
    }

    public function saveAndGetDomain()
    {
        $expected = 'http://localhost:22116';

        Project::saveProperty('domain', $expected);
        $actual = Project::getProperty('domain');

        $this->assertEquals($expected, $actual);
    }
}
