You are here

public function PackageManagerTest::setUp in Ludwig 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/PackageManagerTest.php, line 154

Class

PackageManagerTest
@coversDefaultClass \Drupal\ludwig\PackageManager @group ludwig

Namespace

Drupal\Tests\ludwig\Unit

Code

public function setUp() {
  parent::setUp();
  $structure = [
    'profiles' => [
      'lightning' => [
        'lightning.info.yml' => 'type: profile',
        'ludwig.json' => json_encode($this->packages['extension']['lightning']),
      ],
    ],
    'modules' => [
      'test1' => [
        'ludwig.json' => json_encode($this->packages['extension']['test1']),
        'test1.info.yml' => 'type: module',
      ],
      'test3a' => [
        'ludwig.json' => json_encode($this->packages['extension']['test3a']),
        'test3a.info.yml' => 'type: module',
        'lib' => [
          'html2text-html2text' => [
            'v4.3.1' => [
              'composer.json' => json_encode($this->packages['installed']['html2text/html2text']),
            ],
          ],
        ],
      ],
      'test3b' => [
        'ludwig.json' => json_encode($this->packages['extension']['test3b']),
        'test3b.info.yml' => 'type: module',
        'lib' => [
          'html2text-html2text' => [
            'v4.0.1' => [
              'composer.json' => json_encode($this->packages['installed']['html2text/html2text']),
            ],
          ],
        ],
      ],
      'test3c' => [
        'ludwig.json' => json_encode($this->packages['extension']['test3c']),
        'test3c.info.yml' => 'type: module',
        'lib' => [
          'html2text-html2text' => [
            'v4.3.1' => [
              'composer.json' => json_encode($this->packages['installed']['html2text/html2text']),
            ],
          ],
        ],
      ],
      'entity_print' => [
        'ludwig.json' => json_encode($this->packages['extension']['entity_print']),
        'entity_print.info.yml' => 'type: module',
        'lib' => [
          'dompdf-dompdf' => [
            'v0.8.6' => [
              'composer.json' => json_encode($this->packages['installed']['dompdf/dompdf']),
            ],
          ],
        ],
      ],
      'feeds_ex' => [
        'ludwig.json' => json_encode($this->packages['extension']['feeds_ex']),
        'feeds_ex.info.yml' => 'type: module',
        'lib' => [
          'querypath-QueryPath' => [
            'v3.0.5' => [
              'composer.json' => json_encode($this->packages['installed']['querypath/QueryPath']),
            ],
          ],
        ],
      ],
      'geoip' => [
        'ludwig.json' => json_encode($this->packages['extension']['geoip']),
        'geoip.info.yml' => 'type: module',
        'lib' => [
          'maxmind-web-service-common' => [
            'v0.8.0' => [
              'composer.json' => json_encode($this->packages['installed']['maxmind/web-service-common']),
            ],
          ],
        ],
      ],
    ],
    'sites' => [
      'all' => [
        'modules' => [
          'test2' => [
            'ludwig.json' => json_encode($this->packages['extension']['test2']),
            'test2.info.yml' => 'type: module',
            'lib' => [
              'symfony-config' => [
                'v3.2.8' => [
                  'composer.json' => json_encode($this->packages['installed']['symfony/config']),
                ],
              ],
            ],
          ],
        ],
      ],
    ],
  ];
  vfsStream::setup('drupal', NULL, $structure);
  $this->manager = new PackageManager('vfs://drupal');
}