7 declare(strict_types=1);
20 'MethodAnnotationFixture.php',
21 'method_annotation_errors.txt' 32 private function copyFile(
$source, $destination): void
35 $destinationPath = $destination;
36 $sourceDirectory = opendir($sourcePath);
37 while ($readFile = readdir($sourceDirectory)) {
38 if ($readFile !=
'.' && $readFile !=
'..') {
39 if (!file_exists($destinationPath . $readFile)) {
40 copy($sourcePath . $readFile, $destinationPath . $readFile);
44 closedir($sourceDirectory);
52 public function testProcess($fileUnderTest, $expectedReportFile)
54 $reportFile =
__DIR__ . DIRECTORY_SEPARATOR .
'_files' . DIRECTORY_SEPARATOR .
'phpcs_report.txt';
56 __DIR__ . DIRECTORY_SEPARATOR .
'_files' . DIRECTORY_SEPARATOR,
59 $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer(
62 new \
Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper()
65 [TESTS_TEMP_DIR . $fileUnderTest]
69 TESTS_TEMP_DIR . $expectedReportFile
72 $this->assertEquals(2,
$result);
73 $this->assertEquals($expected, $actual);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
testProcess($fileUnderTest, $expectedReportFile)