You are here

public function ExtensionDiscoveryTest::setUp in Composer Manager 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/ExtensionDiscoveryTest.php, line 23

Class

ExtensionDiscoveryTest
@coversDefaultClass \Drupal\composer_manager\ExtensionDiscovery @group composer_manager

Namespace

Drupal\Tests\composer_manager\Unit

Code

public function setUp() {
  parent::setUp();

  // Simulate modules in multiple sites and multiple profiles.
  $structure = [
    'modules' => [
      'test1' => $this
        ->generateModule('test1'),
    ],
    'profiles' => [
      'commons' => [
        'commons.info.yml' => 'type: profile',
        'commons.profile' => '<?php',
        'modules' => [
          'test2' => $this
            ->generateModule('test2'),
        ],
      ],
    ],
    'sites' => [
      'all' => [
        'modules' => [
          'test3' => $this
            ->generateModule('test3'),
        ],
      ],
      'default' => [
        'modules' => [
          'test4' => $this
            ->generateModule('test4'),
        ],
      ],
      'test.site.com' => [
        'profiles' => [
          'commerce_kickstart' => [
            'commerce_kickstart.info.yml' => 'type: profile',
            'commerce_kickstart.profile' => '<?php',
            'modules' => [
              'test5' => $this
                ->generateModule('test5'),
            ],
          ],
        ],
        'modules' => [
          'test6' => $this
            ->generateModule('test6'),
        ],
      ],
    ],
  ];
  vfsStream::setup('drupal', null, $structure);
  $this->discovery = new ExtensionDiscovery('vfs://drupal');
}