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-amqp/Test/Unit/Topology/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/framework-amqp/Test/Unit/Topology/ArgumentProcessorTest.php
<?php

declare(strict_types=1);

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Framework\Amqp\Test\Unit\Topology;

use InvalidArgumentException;
use Magento\Framework\Amqp\Topology\ArgumentProcessor;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class ArgumentProcessorTest extends TestCase
{
    /**
     * @var ArgumentProcessor|MockObject
     */
    private $argumentProcessor;

    /**
     * @return void
     */
    public function testProcessArgumentsWhenAnyArgumentIsIncorrect(): void
    {
        $arguments = [
            'test' => new class {
            }
        ];

        $this->expectException(InvalidArgumentException::class);
        $this->argumentProcessor->processArguments($arguments);
    }

    /**
     * @return void
     */
    public function testProcessArgumentsWhenAllArgumentAreCorrect(): void
    {
        $arguments = [
            'array_type' => ['some_key' => 'some_value'],
            'numeric_value' => '25',
            'integer_value' => 26,
            'boolean_value' => false,
            'string_value' => 'test'
        ];

        $expected = [
            'array_type' => ['A', ['some_key' => 'some_value']],
            'numeric_value' => ['I', 25],
            'integer_value' => ['I', 26],
            'boolean_value' => ['t', false],
            'string_value' => ['S', 'test']
        ];

        $this->assertSame($expected, $this->argumentProcessor->processArguments($arguments));
    }

    /**
     * @return void
     */
    protected function setUp(): void
    {
        parent::setUp();
        $this->argumentProcessor = $this->getMockForTrait(ArgumentProcessor::class);
    }
}

Spamworldpro Mini