<?php

namespace Firebear\ImportExport\Test\Integration;

class FileExportTest extends \Firebear\ImportExport\Test\Integration\AbstractExport
{
    /**
     * Simple export job.
     * @magentoDbIsolation enabled
     * @magentoAppIsolation enabled
     * @magentoDataFixture Magento/Catalog/_files/products_for_search.php
     */
    public function testSimpleExportJob()
    {
        $job = $this->jobFixtureManager->createExportJob([]);
        $result = $this->runExport($job->getId());
        $this->assertEquals(10, count($result));
    }

    /**
     * Simple export job.
     * @magentoDbIsolation enabled
     * @magentoAppIsolation enabled
     * @magentoDataFixture Firebear_ImportExport::Test/Integration/_files/dropdownAttribute.php
     */
    public function testExportAttributeJob()
    {
        $jobData = [
            'entity' => 'attribute'
        ];
        $job = $this->jobFixtureManager->createExportJob($jobData);
        $result = $this->runExport($job->getId());
        $lastRow = end($result);
        $this->assertEquals('Couleur', $lastRow['frontend_label']);
    }
}
