Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/framework/Indexer/Test/Unit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/framework/Indexer/Test/Unit/CacheContextTest.php
<?php

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\Framework\Indexer\Test\Unit;

use Magento\Framework\Indexer\CacheContext;
use PHPUnit\Framework\TestCase;

class CacheContextTest extends TestCase
{
    /**
     * @var Batch
     */
    private $object;

    protected function setUp(): void
    {
        $this->object = new CacheContext();
    }

    /**
     * @param array $tagsData
     * @param array $expected
     * @dataProvider getTagsDataProvider
     */
    public function testUniqueTags($tagsData, $expected)
    {
        foreach ($tagsData as $tagSet) {
            foreach ($tagSet as $cacheTag => $ids) {
                $this->object->registerEntities($cacheTag, $ids);
            }
        }

        $this->assertEquals($this->object->getIdentities(), $expected);
    }

    /**
     * @return array
     */
    public function getTagsDataProvider()
    {
        return [
            'same entities and ids' => [
                [['cat_p' => [1]], ['cat_p' => [1]]],
                ['cat_p_1']
            ],
            'same entities with overlapping ids' => [
                [['cat_p' => [1, 2, 3]], ['cat_p' => [3]]],
                ['cat_p_1', 'cat_p_2', 'cat_p_3']
            ]
        ];
    }
}

Spamworldpro Mini