![]() 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/App/Test/Unit/Arguments/FileResolver/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\Framework\App\Test\Unit\Arguments\FileResolver; use Magento\Framework\App\Arguments\FileResolver\Primary; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Config\FileIteratorFactory; use Magento\Framework\Filesystem; use Magento\Framework\Filesystem\Directory\Read; use PHPUnit\Framework\TestCase; class PrimaryTest extends TestCase { /** * @param array $fileList * @param string $scope * @param string $filename * @dataProvider getMethodDataProvider */ public function testGet(array $fileList, $scope, $filename) { $directory = $this->createMock(Read::class); $filesystem = $this->createMock(Filesystem::class); $iteratorFactory = $this->createPartialMock(FileIteratorFactory::class, ['create']); $filesystem->expects( $this->once() )->method( 'getDirectoryRead' )->with( DirectoryList::CONFIG )->willReturn( $directory ); $directory->expects($this->once())->method('search')->willReturn($fileList); $iteratorFactory->expects($this->once())->method('create')->willReturn(true); $model = new Primary($filesystem, $iteratorFactory); $this->assertTrue($model->get($filename, $scope)); } /** * @return array */ public function getMethodDataProvider() { return [[['config/di.xml', 'config/some_config/di.xml'], 'primary', 'di.xml']]; } }