Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Static Public Member Functions | Static Protected Attributes
LibraryLocationTest Class Reference
Inheritance diagram for LibraryLocationTest:

Public Member Functions

 testOldWebLibrariesLocation ()
 
 testOldPhpLibrariesLocation ()
 

Static Public Member Functions

static setUpBeforeClass ()
 

Static Protected Attributes

static $root
 

Detailed Description

Definition at line 12 of file LibraryLocationTest.php.

Member Function Documentation

◆ setUpBeforeClass()

static setUpBeforeClass ( )
static

Definition at line 21 of file LibraryLocationTest.php.

22  {
23  self::$root = BP;
24  }
const BP
Definition: autoload.php:14

◆ testOldPhpLibrariesLocation()

testOldPhpLibrariesLocation ( )

Definition at line 32 of file LibraryLocationTest.php.

33  {
34  $libLocation = self::$root . '/lib';
35 
36  $permittedEntries = [
37  self::$root . '/lib/web',
38  self::$root . '/lib/internal',
39  self::$root . '/.htaccess',
40  ];
41 
42  $entries = glob("{$libLocation}/*");
43  $excessiveEntries = [];
44  foreach ($entries as $entry) {
45  $entry = str_replace('\\', '/', $entry);
46  $permitted = false;
47  foreach ($permittedEntries as $permittedEntry) {
48  if ($permittedEntry == $entry) {
49  $permitted = true;
50  break;
51  }
52  }
53  if (!$permitted) {
54  $excessiveEntries[] = $entry;
55  }
56  }
57 
58  $this->assertEmpty(
59  $excessiveEntries,
60  "All files and directories have been moved from 'lib' to 'lib/internal'"
61  );
62  }

◆ testOldWebLibrariesLocation()

testOldWebLibrariesLocation ( )

Definition at line 26 of file LibraryLocationTest.php.

27  {
28  $oldLocation = self::$root . '/pub/lib';
29  $this->assertFileNotExists($oldLocation, "The web libraries have been moved from 'pub/lib' to 'lib/web'");
30  }

Field Documentation

◆ $root

$root
staticprotected

Definition at line 19 of file LibraryLocationTest.php.


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