init
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test to ensure that readme file present in specified directories
|
||||
*/
|
||||
namespace Magento\Test\Integrity\Readme;
|
||||
|
||||
use Magento\Framework\App\Utility\Files;
|
||||
|
||||
class ReadmeTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
const README_FILENAME = 'README.md';
|
||||
|
||||
const BLACKLIST_FILES_PATTERN = '_files/blacklist/*.txt';
|
||||
|
||||
const SCAN_LIST_FILE = '_files/scan_list.txt';
|
||||
|
||||
/** @var array Blacklisted files and directories */
|
||||
private $blacklist = [];
|
||||
|
||||
/** @var array */
|
||||
private $scanList = [];
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->blacklist = $this->getPaths(__DIR__ . '/' . self::BLACKLIST_FILES_PATTERN);
|
||||
$this->scanList = $this->getPaths(__DIR__ . '/' . self::SCAN_LIST_FILE);
|
||||
}
|
||||
|
||||
public function testReadmeFiles()
|
||||
{
|
||||
$invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
|
||||
$invoker(
|
||||
/**
|
||||
* @param string $dir
|
||||
*/
|
||||
function ($dir) {
|
||||
$file = $dir . DIRECTORY_SEPARATOR . self::README_FILENAME;
|
||||
$this->assertFileExists(
|
||||
$file,
|
||||
sprintf('File %s not found in %s', self::README_FILENAME, $dir)
|
||||
);
|
||||
},
|
||||
$this->getDirectories()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getDirectories()
|
||||
{
|
||||
$directories = [];
|
||||
foreach ($this->scanList as $dir) {
|
||||
if (!$this->isInBlacklist($dir)) {
|
||||
$directories[][] = $dir;
|
||||
}
|
||||
}
|
||||
|
||||
return $directories;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @return bool
|
||||
*/
|
||||
private function isInBlacklist($path)
|
||||
{
|
||||
return in_array($path, $this->blacklist);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get paths basing on the file with patterns
|
||||
*
|
||||
* @param string $patternsFile
|
||||
* @return array
|
||||
*/
|
||||
private function getPaths($patternsFile)
|
||||
{
|
||||
$result = [];
|
||||
$files = Files::init()->readLists($patternsFile);
|
||||
foreach ($files as $file) {
|
||||
if (is_dir($file)) {
|
||||
$result[] = rtrim($file, '/');
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
module Magento_CatalogImportExport /
|
||||
module Magento_CatalogUrlRewrite /
|
||||
module Magento_CmsUrlRewrite /
|
||||
module Magento_ConfigurableImportExport /
|
||||
module Magento_GroupedImportExport /
|
||||
module Magento_Msrp /
|
||||
module Magento_TaxImportExport /
|
||||
module Magento_Translation /
|
||||
library magento/framework Acl
|
||||
library magento/framework Api
|
||||
library magento/framework Authorization
|
||||
library magento/framework Cache
|
||||
library magento/framework Config
|
||||
library magento/framework DB
|
||||
library magento/framework DomDocument
|
||||
library magento/framework Filter
|
||||
library magento/framework HTTP
|
||||
library magento/framework Interception
|
||||
library magento/framework Json
|
||||
library magento/framework Mail
|
||||
library magento/framework Mview
|
||||
library magento/framework Notification
|
||||
library magento/framework Oauth
|
||||
library magento/framework Parse
|
||||
library magento/framework Pricing
|
||||
library magento/framework Reflection
|
||||
library magento/framework RequireJs
|
||||
library magento/framework Search
|
||||
library magento/framework Simplexml
|
||||
library magento/framework System
|
||||
library magento/framework Test
|
||||
library magento/framework App/Utility
|
||||
library magento/framework Url
|
||||
library magento/framework Xml
|
||||
library magento/framework XsltProcessor
|
||||
library magento/framework /
|
||||
@@ -0,0 +1,3 @@
|
||||
module * /
|
||||
library * /
|
||||
library magento/framework */
|
||||
Reference in New Issue
Block a user