<?php

namespace Tests\Unit\Framework;

use Openguru\OpenCartFramework\QueryBuilder\RawExpression;
use PHPUnit\Framework\TestCase;

class RawExpressionTest extends TestCase
{
    public function testConstructorSetsValue(): void
    {
        $value = 'NOW()';
        $expression = new RawExpression($value);

        $this->assertEquals($value, $expression->getValue());
    }

    public function testGetValueReturnsCorrectValue(): void
    {
        $value = 'COUNT(*)';
        $expression = new RawExpression($value);

        $this->assertEquals($value, $expression->getValue());
    }

    public function testCanHandleComplexExpressions(): void
    {
        $value = 'DATE_FORMAT(created_at, "%Y-%m-%d")';
        $expression = new RawExpression($value);

        $this->assertEquals($value, $expression->getValue());
    }

    public function testCanHandleEmptyString(): void
    {
        $expression = new RawExpression('');

        $this->assertEquals('', $expression->getValue());
    }
}

