Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
deployTestModules.php
Go to the documentation of this file.
1 <?php
13 $pathToInstalledMagentoInstanceModules = $testFrameworkDir . '/../../../../app/code/Magento';
14 $iterator = new RecursiveIteratorIterator(
15  new RecursiveDirectoryIterator($pathToCommittedTestModules, RecursiveDirectoryIterator::FOLLOW_SYMLINKS)
16 );
18 foreach ($iterator as $file) {
19  if (!$file->isDir()) {
20  $source = $file->getPathname();
23  $targetDir = dirname($destination);
24  if (!is_dir($targetDir)) {
25  mkdir($targetDir, 0755, true);
26  }
27  copy($source, $destination);
28  }
29 }
30 unset($iterator, $file);
31 
32 // Register the modules under '_files/'
33 $pathPattern = $pathToInstalledMagentoInstanceModules . '/TestModule*/registration.php';
34 $files = glob($pathPattern, GLOB_NOSORT);
35 if ($files === false) {
36  throw new \RuntimeException('glob() returned error while searching in \'' . $pathPattern . '\'');
37 }
38 foreach ($files as $file) {
39  include $file;
40 }
$pathToInstalledMagentoInstanceModules
$pathPattern
$source
Definition: source.php:23
$pathToCommittedTestModules
mkdir($pathname, $mode=0777, $recursive=false, $context=null)
Definition: ioMock.php:25
$relativePath
Definition: get.php:35
$testFrameworkDir
Definition: bootstrap.php:46