<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Tests\Unit\Services\Analyzators\Validators;

use Seka\Portal\Modul\Statistiky\Services\Analyzators\Validators\Generic;
use Seka\Portal\Modul\Statistiky\Tests\TestCase;

/**
 * Class GenericTest
 *
 * @package Seka\Portal\Modul\Statistiky\Tests\Unit\Services\Analyzators\Validators
 */
class GenericTest extends TestCase
{
    /**
     *
     */
    public function testValidate()
    {
        $validator = new Generic();

        self::assertTrue($validator->validate('test'));
    }

    /**
     *
     */
    public function testValidateEmptyValue()
    {
        $validator = new Generic();

        self::assertTrue($validator->validate(''));
    }

    /**
     *
     */
    public function testValidateNullValue()
    {
        $validator = new Generic();

        self::assertTrue($validator->validate(null));
    }

    /**
     *
     */
    public function testGetErrorMsgWithError()
    {
        $validator = new Generic();
        $validator->validate('random');
        $message = '';
        $actualMessage = $validator->getErrorMsg('random');

        self::assertEquals($message, $actualMessage);
        self::assertIsString($actualMessage);
    }

    /**
     *
     */
    public function testGetTokens()
    {
        $validator = new Generic();

        self::assertIsArray($validator->getTokens());
        self::assertEmpty($validator->getTokens());
    }
}
