Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for license ..

Decoded Output download

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

namespace Magento\Catalog\Test\Unit\Model\Layer\Filter;

use Magento\Catalog\Model\Layer\Filter\DataProvider\DecimalFactory;
use Magento\Catalog\Model\Layer\Filter\Decimal;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\TestCase;

class DecimalTest extends TestCase
{
    public function testConstructorRequestVarIsOverwrittenCorrectlyInParent()
    {
        $attributeModel = $this->createPartialMock(
            Attribute::class,
            ['getAttributeCode']
        );
        $attributeModel->expects($this->once())->method('getAttributeCode')->willReturn('price1');

        $objectManager = new ObjectManager($this);

        $dataProviderFactory = $this->getMockBuilder(
            DecimalFactory::class
        )
            ->disableOriginalConstructor()
            ->onlyMethods(['create'])
            ->getMock();
        $instance = $objectManager->getObject(
            Decimal::class,
            [
                'data' => [
                    'attribute_model' => $attributeModel,
                ],
                'dataProviderFactory' => $dataProviderFactory
            ]
        );
        $this->assertSame('price1', $instance->getRequestVar());
    }
}
 ?>

Did this file decode correctly?

Original Code

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

namespace Magento\Catalog\Test\Unit\Model\Layer\Filter;

use Magento\Catalog\Model\Layer\Filter\DataProvider\DecimalFactory;
use Magento\Catalog\Model\Layer\Filter\Decimal;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\TestCase;

class DecimalTest extends TestCase
{
    public function testConstructorRequestVarIsOverwrittenCorrectlyInParent()
    {
        $attributeModel = $this->createPartialMock(
            Attribute::class,
            ['getAttributeCode']
        );
        $attributeModel->expects($this->once())->method('getAttributeCode')->willReturn('price1');

        $objectManager = new ObjectManager($this);

        $dataProviderFactory = $this->getMockBuilder(
            DecimalFactory::class
        )
            ->disableOriginalConstructor()
            ->onlyMethods(['create'])
            ->getMock();
        $instance = $objectManager->getObject(
            Decimal::class,
            [
                'data' => [
                    'attribute_model' => $attributeModel,
                ],
                'dataProviderFactory' => $dataProviderFactory
            ]
        );
        $this->assertSame('price1', $instance->getRequestVar());
    }
}

Function Calls

None

Variables

None

Stats

MD5 fc1423a6ae468c2d5472e4c8c2e96d2a
Eval Count 0
Decode Time 107 ms