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\ResourceModel\Product\Indexer\Price;
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster;
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
class CompositeProductBatchSizeAdjusterTest extends TestCase
{
/**
* @var CompositeProductBatchSizeAdjuster
*/
private $model;
/**
* @var MockObject|CompositeProductRelationsCalculator
*/
private $relationsCalculatorMock;
protected function setUp(): void
{
$this->relationsCalculatorMock = $this->getMockBuilder(CompositeProductRelationsCalculator::class)
->disableOriginalConstructor()
->getMock();
$this->model = new CompositeProductBatchSizeAdjuster($this->relationsCalculatorMock);
}
public function testAdjust()
{
$this->relationsCalculatorMock->expects($this->once())
->method('getMaxRelationsCount')
->willReturn(200);
$this->assertEquals(25, $this->model->adjust(5000));
}
}
?>
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\ResourceModel\Product\Indexer\Price;
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductBatchSizeAdjuster;
use Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\CompositeProductRelationsCalculator;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
class CompositeProductBatchSizeAdjusterTest extends TestCase
{
/**
* @var CompositeProductBatchSizeAdjuster
*/
private $model;
/**
* @var MockObject|CompositeProductRelationsCalculator
*/
private $relationsCalculatorMock;
protected function setUp(): void
{
$this->relationsCalculatorMock = $this->getMockBuilder(CompositeProductRelationsCalculator::class)
->disableOriginalConstructor()
->getMock();
$this->model = new CompositeProductBatchSizeAdjuster($this->relationsCalculatorMock);
}
public function testAdjust()
{
$this->relationsCalculatorMock->expects($this->once())
->method('getMaxRelationsCount')
->willReturn(200);
$this->assertEquals(25, $this->model->adjust(5000));
}
}
Function Calls
None |
Stats
MD5 | 010ad9acc58ac59e9fa9cb107ca207fb |
Eval Count | 0 |
Decode Time | 101 ms |