Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RootComposerMappingTest.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Tools\Composer\Package\Reader;
9 
13 class RootComposerMappingTest extends \PHPUnit\Framework\TestCase
14 {
19  public function testMapping()
20  {
21  //Checking existence of composer components
22  $reader = new Reader(BP . '/dev/tools/Magento/Tools/Composer');
23  $patterns = $reader->getPatterns();
24  $counter = 0;
25  $count = count($patterns);
26  for ($i = 0; $i < $count; $i++) {
27  if (file_exists(BP . '/' . $patterns[$i])) {
28  $counter++;
29  }
30  }
31 
32  $this->assertEquals($count, $counter);
33 
34  //Checking existence of customizable paths
35  $customizablePaths = $reader->getCustomizablePaths();
36  $counter = 0;
37  $count = count($customizablePaths);
38  for ($i = 0; $i < $count; $i++) {
39  if (file_exists(BP . '/' . str_replace('*', '', $customizablePaths[$i]))) {
40  $counter++;
41  }
42  }
43 
44  $this->assertEquals($count, $counter);
45  }
46 }
$count
Definition: recent.phtml:13
const BP
Definition: autoload.php:14
$i
Definition: gallery.phtml:31