<?php

namespace App\Tests\Entity;

use App\Entity\PriceAutomatic;
use PHPUnit\Framework\TestCase;

class PriceAutomaticTest extends TestCase
{
    public function testGettersSetters(): void
    {
        $p = new PriceAutomatic();
        $p->setType('esyweb_business');
        $p->setTitle('Esy-Web Business');
        $p->setDescription('Test description');
        $p->setPriceHt('500.00');
        $p->setMonthPrice('100.00');
        $p->setPeriod(1);
        $p->setStripeId('price_xxx');
        $p->setStripeAbonnementId('price_yyy');

        $this->assertNull($p->getId());
        $this->assertSame('esyweb_business', $p->getType());
        $this->assertSame('Esy-Web Business', $p->getTitle());
        $this->assertSame('Test description', $p->getDescription());
        $this->assertSame('500.00', $p->getPriceHt());
        $this->assertSame('100.00', $p->getMonthPrice());
        $this->assertSame(1, $p->getPeriod());
        $this->assertSame('price_xxx', $p->getStripeId());
        $this->assertSame('price_yyy', $p->getStripeAbonnementId());
    }

    public function testNullables(): void
    {
        $p = new PriceAutomatic();
        $p->setType('test');
        $p->setTitle('Test');
        $p->setPriceHt('0.00');

        $this->assertNull($p->getDescription());
        $this->assertNull($p->getStripeId());
        $this->assertNull($p->getStripeAbonnementId());
    }
}
