SitemapConfigReaderTest.php 1.86 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Sitemap\Model;

use Magento\Store\Model\Store;
use Magento\TestFramework\Helper\Bootstrap;

class SitemapConfigReaderTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @var SitemapConfigReader
     */
    private $model = null;

    protected function setUp()
    {
        $this->model = Bootstrap::getObjectManager()->get(SitemapConfigReader::class);
    }

    /**
     * @magentoConfigFixture default_store sitemap/search_engines/submission_robots 1
     */
    public function testGetEnableSubmissionRobots()
    {
        $this->assertEquals(0, $this->model->getEnableSubmissionRobots(Store::DEFAULT_STORE_ID));
        $this->assertEquals(1, $this->model->getEnableSubmissionRobots(Store::DISTRO_STORE_ID));
    }

    /**
     * @magentoConfigFixture default_store sitemap/limit/max_lines 10
     */
    public function testGetMaximumLinesNumber()
    {
        $this->assertEquals(50000, $this->model->getMaximumLinesNumber(Store::DEFAULT_STORE_ID));
        $this->assertEquals(10, $this->model->getMaximumLinesNumber(Store::DISTRO_STORE_ID));
    }

    /**
     * @magentoConfigFixture default_store sitemap/limit/max_file_size 1024
     */
    public function testGetMaximumFileSize()
    {
        $this->assertEquals(10485760, $this->model->getMaximumFileSize(Store::DEFAULT_STORE_ID));
        $this->assertEquals(1024, $this->model->getMaximumFileSize(Store::DISTRO_STORE_ID));
    }

    /**
     * @magentoConfigFixture default_store sitemap/product/image_include base
     */
    public function testGetProductImageIncludePolicy()
    {
        $this->assertEquals('all', $this->model->getProductImageIncludePolicy(Store::DEFAULT_STORE_ID));
        $this->assertEquals('base', $this->model->getProductImageIncludePolicy(Store::DISTRO_STORE_ID));
    }
}