/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/static/testsuite/Magento/Test/Integrity/TestPlacementTest.php
62 строки
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ /** * Test to ensure that readme file present in specified directories */ namespace Magento\Test\Integrity; use Magento\Framework\App\Utility\Files; use \Magento\Framework\App\Bootstrap; class TestPlacementTest extends \PHPUnit\Framework\TestCase { /** @var array */ private $scanList = ['dev/tests/unit/testsuite/Magento']; /** * @var string Path to project root */ private $root; protected function setUp(): void { $this->root = BP; } public function testUnitTestFilesPlacement() { $objectManager = Bootstrap::create(BP, $_SERVER)->getObjectManager(); /** @var \Magento\Framework\Data\Collection\Filesystem $filesystem */ $filesystem = $objectManager->get(\Magento\Framework\Data\Collection\Filesystem::class); $filesystem->setCollectDirs(false) ->setCollectFiles(true) ->setCollectRecursively(true); $targetsExist = false; foreach ($this->scanList as $dir) { if (realpath($this->root . DIRECTORY_SEPARATOR . $dir)) { $filesystem->addTargetDir($this->root . DIRECTORY_SEPARATOR . $dir); $targetsExist = true; } } if ($targetsExist) { $files = $filesystem->load()->toArray(); $fileList = []; foreach ($files['items'] as $file) { $fileList[] = $file['filename']; } $this->assertEquals( 0, $files['totalRecords'], "The following files have been found in obsolete test directories: \n" . implode("\n", $fileList) ); } } }