6 declare(strict_types=1);
18 'ClassAnnotationFixture.php',
19 'class_annotation_errors.txt',
22 'AbstractClassAnnotationFixture.php',
23 'abstract_class_annotation_errors.txt',
26 'ClassAnnotationNoShortDescriptionFixture.php',
27 'class_annotation_noshortdescription_errors.txt',
30 'ClassAnnotationNoSpacingBetweenLinesFixture.php',
31 'class_annotation_nospacingbetweenLines_errors.txt',
42 private function copyFile(
$source, $destination) : void
45 $destinationPath = $destination;
46 $sourceDirectory = opendir($sourcePath);
47 while ($readFile = readdir($sourceDirectory)) {
48 if ($readFile !=
'.' && $readFile !=
'..') {
49 if (!file_exists($destinationPath . $readFile)) {
50 copy($sourcePath . $readFile, $destinationPath . $readFile);
54 closedir($sourceDirectory);
62 public function testProcess($fileUnderTest, $expectedReportFile)
64 $reportFile =
__DIR__ . DIRECTORY_SEPARATOR .
'_files' . DIRECTORY_SEPARATOR .
'phpcs_report.txt';
66 __DIR__ . DIRECTORY_SEPARATOR .
'_files'. DIRECTORY_SEPARATOR,
69 $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer(
72 new \
Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper()
75 [TESTS_TEMP_DIR . $fileUnderTest]
79 TESTS_TEMP_DIR . $expectedReportFile
82 $this->assertEquals(2,
$result);
83 $this->assertEquals($expected, $actual);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testProcess($fileUnderTest, $expectedReportFile)