Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CodingStandardsIgnoreAnnotationUsageTest.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Test\Legacy;
8 
9 use PHPUnit\Framework\TestCase;
11 
13 {
14  public function testAnnotationUsage()
15  {
16  $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
17  $invoker(
18  function ($filename) {
19  $fileText = file_get_contents($filename);
20  if (strpos($fileText, '@codingStandardsIgnoreFile') !== false) {
21  $this->fail(
22  '@codingStandardsIgnoreFile annotation must be avoided. '
23  . 'Use codingStandardsIgnoreStart/codingStandardsIgnoreEnd to suppress code fragment '
24  . 'or use codingStandardsIgnoreLine to suppress line. '
25  . $filename
26  );
27  }
28  },
29  Files::init()->getPhpFiles(
35  )
36  );
37  }
38 }