<?php

/**
 * Created by PhpStorm.
 * User: filip
 * Date: 7/8/16
 * Time: 1:40 PM.
 */
class VariationTest extends DatabaseTestCase
{
    public function testCreateFromArray()
    {
        $array = [
            'id' => null,
            'title' => null,
            'discount' => null,
            'vat' => null,
            'delivery_time' => null,
            'code' => null,
            'id_variation' => 5,
            'variation_title' => 'title',
        ];

        $variation = new Variation();

        $variation->createFromArray($array);

        $this->assertSame([
            $array['id_variation'],
            $array['variation_title'],
        ], [
            $variation->variationId,
            $variation->variationTitle,
        ]);
    }
}
