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 10:47:39
MySQL : OFF | MSSQL : OFF | cURL : ON | Oracle : OFF | wget : ON | Perl : ON

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

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

File Path : /home/dev2.destoffenstraat.com/vendor-1/magento/framework/Validator/Test/Unit/FactoryTest.php

<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\Validator\Test\Unit; use Magento\Framework\Cache\FrontendInterface; use Magento\Framework\Config\FileIterator; use Magento\Framework\Module\Dir\Reader; use Magento\Framework\ObjectManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Translate\Adapter; use Magento\Framework\Translate\AdapterInterface; use Magento\Framework\Validator; use Magento\Framework\Validator\AbstractValidator; use Magento\Framework\Validator\Builder; use Magento\Framework\Validator\Config; use Magento\Framework\Validator\Factory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class FactoryTest extends TestCase { /** * @var ObjectManagerInterface|MockObject */ private $objectManagerMock; /** * @var Reader|MockObject */ private $readerMock; /** * @var Config|MockObject */ private $validatorConfigMock; /** * @var FileIterator|MockObject */ private $fileIteratorMock; /** * @var AdapterInterface */ private $defaultTranslator; /** * @var Factory */ private $factory; /** * @var array */ private $data = ['/tmp/moduleOne/etc/validation.xml']; protected function setUp(): void { $this->defaultTranslator = AbstractValidator::getDefaultTranslator(); $this->objectManagerMock = $this->getMockForAbstractClass(ObjectManagerInterface::class); $this->validatorConfigMock = $this->createPartialMock( Config::class, ['createValidatorBuilder', 'createValidator'] ); $translateAdapterMock = $this->createMock(Adapter::class); $this->objectManagerMock->expects($this->at(0)) ->method('create') ->with(Adapter::class) ->willReturn($translateAdapterMock); $this->fileIteratorMock = $this->createMock(FileIterator::class); $this->objectManagerMock->expects($this->at(1)) ->method('create') ->with( Config::class, ['configFiles' => $this->fileIteratorMock] ) ->willReturn($this->validatorConfigMock); $this->readerMock = $this->createPartialMock( Reader::class, ['getConfigurationFiles'] ); $this->cacheMock = $this->getMockForAbstractClass(FrontendInterface::class); $objectManager = new ObjectManager($this); $this->factory = $objectManager->getObject( Factory::class, [ 'objectManager' => $this->objectManagerMock, 'moduleReader' => $this->readerMock ] ); } /** * Restore default translator */ protected function tearDown(): void { AbstractValidator::setDefaultTranslator($this->defaultTranslator); unset($this->defaultTranslator); } public function testGetValidatorConfig() { $this->readerMock->method('getConfigurationFiles') ->with('validation.xml') ->willReturn($this->fileIteratorMock); $this->fileIteratorMock->method('toArray') ->willReturn($this->data); $actualConfig = $this->factory->getValidatorConfig(); $this->assertInstanceOf( Config::class, $actualConfig, 'Object of incorrect type was created' ); $this->assertInstanceOf( Adapter::class, AbstractValidator::getDefaultTranslator(), 'Default validator translate adapter was not set correctly' ); } public function testCreateValidatorBuilder() { $this->readerMock->method('getConfigurationFiles') ->with('validation.xml') ->willReturn($this->fileIteratorMock); $this->fileIteratorMock->method('toArray') ->willReturn($this->data); $builderMock = $this->createMock(Builder::class); $this->validatorConfigMock->expects($this->once()) ->method('createValidatorBuilder') ->with('test', 'class', []) ->willReturn($builderMock); $this->assertInstanceOf( Builder::class, $this->factory->createValidatorBuilder('test', 'class', []) ); } public function testCreateValidator() { $this->readerMock->method('getConfigurationFiles') ->with('validation.xml') ->willReturn($this->fileIteratorMock); $this->fileIteratorMock->method('toArray') ->willReturn($this->data); $validatorMock = $this->createMock(Validator::class); $this->validatorConfigMock->expects($this->once()) ->method('createValidator') ->with('test', 'class', []) ->willReturn($validatorMock); $this->assertInstanceOf( Validator::class, $this->factory->createValidator('test', 'class', []) ); } }