Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
LicenseTest Class Reference
Inheritance diagram for LicenseTest:

Public Member Functions

 testLegacyComment ()
 
 legacyCommentDataProvider ()
 

Detailed Description

Definition at line 12 of file LicenseTest.php.

Member Function Documentation

◆ legacyCommentDataProvider()

legacyCommentDataProvider ( )

Definition at line 38 of file LicenseTest.php.

39  {
40  $allFiles = \Magento\Framework\App\Utility\Files::init()->getAllFiles();
41  $result = [];
42  foreach ($allFiles as $file) {
43  if (!file_exists($file[0]) || !is_readable($file[0])) {
44  continue;
45  }
46  $result[] = [$file[0]];
47  }
48  return $result;
49  }

◆ testLegacyComment()

testLegacyComment ( )

Definition at line 14 of file LicenseTest.php.

15  {
16  $invoker = new \Magento\Framework\App\Utility\AggregateInvoker($this);
17  $invoker(
18  function ($filename) {
19  $fileText = file_get_contents($filename);
20  if (!preg_match_all('#/\*\*.+@copyright.+?\*/#s', $fileText, $matches)) {
21  return;
22  }
23 
24  foreach ($matches[0] as $commentText) {
25  foreach (['Irubin Consulting Inc', 'DBA Varien', 'Magento Inc'] as $legacyText) {
26  $this->assertNotContains(
27  $legacyText,
28  $commentText,
29  "The license of file {$filename} contains legacy text."
30  );
31  }
32  }
33  },
35  );
36  }

The documentation for this class was generated from the following file: