<?php

/*
 * This file is part of the VITICORE2 package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CpCreation\VitiCore\Tests\Contact\Model;

use CpCreation\VitiCore\Contact\Model\Contact;
use PHPUnit\Framework\TestCase;

final class ContactTest extends TestCase
{
    public function testStoresLegalContents(): void
    {
        $contact = new Contact();

        $contact->setLegalNoticeContent('<p>Mentions légales</p>');
        $contact->setPrivacyPolicyContent('<p>Politique de confidentialité</p>');

        self::assertSame('<p>Mentions légales</p>', $contact->getLegalNoticeContent());
        self::assertSame('<p>Politique de confidentialité</p>', $contact->getPrivacyPolicyContent());
    }

    public function testStoresLocalBusinessData(): void
    {
        $contact = new Contact();
        $openingHours = [[
            'dayOfWeek' => ['Monday', 'Tuesday'],
            'opens' => '09:00',
            'closes' => '18:00',
        ]];

        $contact->setCountry('fr');
        $contact->setLatitude('49.0434000');
        $contact->setLongitude('3.9560000');
        $contact->setOpeningHours($openingHours);

        self::assertSame('FR', $contact->getCountry());
        self::assertSame('49.0434000', $contact->getLatitude());
        self::assertSame('3.9560000', $contact->getLongitude());
        self::assertSame($openingHours, $contact->getOpeningHours());
    }
}
